Commit a0b1281e authored by John van Groningen's avatar John van Groningen
Browse files

fix bug in adjusting stack pointers in code for then and else of if expressions

parent 051a13fa
......@@ -2832,14 +2832,8 @@ static void fill_strict_if_node (Node node,int *asp_p,int *bsp_p,CodeGenNodeIdsP
for (i=a_size-1; i>=0; --i)
GenPushA (difference-1);
if (a_size>0){
GenBuildh (&nil_lab,0);
for (i=0; i<a_size; ++i)
GenUpdateA (0,difference+i);
GenPopA (1);
}
for (i=0; i<a_size; ++i)
GenUpdateA (difference-1/*offset of _Nil*/,difference+i);
} else {
for (i=difference-1; i>=0; --i)
GenPushA (difference-1);
......@@ -2892,14 +2886,8 @@ static void fill_strict_if_node (Node node,int *asp_p,int *bsp_p,CodeGenNodeIdsP
for (i=b_size-1; i>=0; --i)
GenPushB (difference-1);
if (b_size>0){
PushBasic (IntObj,sv);
for (i=0; i<b_size; ++i)
GenUpdateB (0,difference+i);
GenPopB (1);
}
for (i=0; i<b_size; ++i)
GenUpdateB (difference-1/*offset of int 0*/,difference+i);
} else {
for (i=difference-1; i>=0; --i)
GenPushB (difference-1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment