summaryrefslogtreecommitdiff
path: root/6/gengas.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-09 16:49:09 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-09 16:49:09 -0700
commited8711e68e441e9884d734932373317834665833 (patch)
tree08a3f37550af1b6adb1ad912ee6df70fa6c1ceaf /6/gengas.c
parentbd5fb6d0628831cde25f13e3fe461786d616a06e (diff)
downloadmc-ed8711e68e441e9884d734932373317834665833.tar.gz
Refactor code to add jump tables, and prepare to generate them.
Diffstat (limited to '6/gengas.c')
-rw-r--r--6/gengas.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/6/gengas.c b/6/gengas.c
index 16f29a4..926fff9 100644
--- a/6/gengas.c
+++ b/6/gengas.c
@@ -298,7 +298,7 @@ static size_t writelit(FILE *fd, Htab *strtab, Node *v, Type *ty)
if (hthas(strtab, &v->lit.strval)) {
lbl = htget(strtab, &v->lit.strval);
} else {
- lbl = genlocallblstr(buf, sizeof buf);
+ lbl = genlblstr(buf, sizeof buf);
htput(strtab, &v->lit.strval, strdup(lbl));
}
fprintf(fd, "\t.quad %s\n", lbl);
@@ -307,6 +307,9 @@ static size_t writelit(FILE *fd, Htab *strtab, Node *v, Type *ty)
case Lfunc:
die("Generating this shit ain't ready yet ");
break;
+ case Ljtab:
+ die("jtab as data?");
+ break;
case Llbl:
die("Can't generate literal labels, ffs. They're not data.");
break;