diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-17 21:12:54 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-17 21:12:54 -0400 |
commit | 10b6fe1de74b82fa386a3ca6e49f64e801339e34 (patch) | |
tree | d33b5f5f78567181d990fa45bdeeecdf5b41bca5 /lisc | |
parent | 4d7c42d4fb504ec71ff616b621a19bead19d362d (diff) | |
download | roux-10b6fe1de74b82fa386a3ca6e49f64e801339e34.tar.gz |
add hack in emit to support stack arguments
The number stored in the .val field of SLOTs has to be sign extended, so we can reach into the caller's frame when necessary (arguments passed on the stack).
Diffstat (limited to 'lisc')
-rw-r--r-- | lisc/emit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisc/emit.c b/lisc/emit.c index 535bf18..7b15229 100644 --- a/lisc/emit.c +++ b/lisc/emit.c @@ -80,9 +80,11 @@ Next: fprintf(f, "%%%s", rsub[ref.val][ty]); break; case RSlot: - Slot: - fprintf(f, "%d(%%rbp)", -4 * ref.val); + Slot: { + struct { int i:14; } x = {ref.val}; /* fixme, HACK */ + fprintf(f, "%d(%%rbp)", -4 * x.i); break; + } case RCon: fputc('$', f); Con: |