Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Commit adbafc6

Browse files
committed
Lab1.
1 parent f43bbfd commit adbafc6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/slp/Main.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private void compileExp(Exp.T exp)
124124
emit("\tmovl\t%eax, %ecx\n");
125125
emit("\tmovl\t%edx, %eax\n");
126126
emit("\tcltd\n");
127-
emit("\tdiv\n");
127+
emit("\tdiv\t%ecx\n");
128128
break;
129129
default:
130130
new Bug();
@@ -237,7 +237,8 @@ public void doit(Stm.T prog)
237237
writer.write(buf.toString());
238238
writer.write("\tleave\n\tret\n\n");
239239
writer.close();
240-
Runtime.getRuntime().exec("gcc slp_gen.s");
240+
Process child = Runtime.getRuntime().exec("gcc slp_gen.s");
241+
child.waitFor();
241242
if (!Control.ConSlp.keepasm)
242243
Runtime.getRuntime().exec("rm -rf slp_gen.s");
243244
} catch (Exception e) {

0 commit comments

Comments
 (0)