From: Ian Jackson Date: Mon, 19 Jul 2021 23:44:04 +0000 (+0100) Subject: lowering: Do not construct range iter for empty plan entries X-Git-Tag: otter-0.7.2~25 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9b0e2ae30a5e50ed7c61a3c289aac0c86c06f9db;p=otter.git lowering: Do not construct range iter for empty plan entries We are going to want to let these have malformed reanges. Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 1a898ce0..6f070409 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -798,7 +798,8 @@ function lower_pieces(targets_todo: LowerTodoList): for (const pe of plan) { let z_top = pe.z_top; let z_bot = pe.z_bot; - if (pe.content.length != 0 && z_bot == null) { + if (! pe.content.length) continue; + if (z_bot == null) { let first_z = pe.content[0].p.z; if (z_top >= first_z) z_top = first_z;