Skip to content

Commit a5957dc

Browse files
committed
Fix push_list_back on empty DoubleEndedList.
1 parent d0f6b47 commit a5957dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Compiler/Util/DoubleEndedList.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ algorithm
180180
return;
181181
end if;
182182
arrayUpdate(delst.length, 1, length+lstLength);
183-
tail := arrayGet(delst.back, 1);
184183
t := listGet(lst, 1);
185184
tmp := {t};
186-
Dangerous.listSetRest(tail, tmp);
187185
if length==0 then
188186
arrayUpdate(delst.front, 1, tmp);
187+
else
188+
Dangerous.listSetRest(arrayGet(delst.back, 1), tmp);
189189
end if;
190190
tail := tmp;
191191
for l in listRest(lst) loop

0 commit comments

Comments
 (0)