chiark / gitweb /
lowering: Do not construct range iter for empty plan entries
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Jul 2021 23:44:04 +0000 (00:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Jul 2021 23:44:57 +0000 (00:44 +0100)
We are going to want to let these have malformed reanges.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index 1a898ce0fd88a36f6d69ec67943db2fdbec93d6e..6f07040925d85f43fe9683e26b32320cfa934e67 100644 (file)
@@ -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;