summaryrefslogtreecommitdiff
path: root/parse/specialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse/specialize.c')
-rw-r--r--parse/specialize.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/parse/specialize.c b/parse/specialize.c
index 6cf5aa9..f7315e2 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -177,10 +177,18 @@ static void fixup(Node *n)
break;
case Nlit:
switch (n->lit.littype) {
- case Lfunc: fixup(n->lit.fnval); break;
case Lchr: case Lint: case Lflt:
case Lstr: case Llbl: case Lbool:
break;
+ case Lfunc:
+ fixup(n->lit.fnval);
+ break;
+ case Ljtab:
+ for (i = 0; i < n->lit.jtab->nval; i++) {
+ fixup(n->lit.jtab->val[i]);
+ fixup(n->lit.jtab->dst[i]);
+ }
+ break;
}
break;
case Nifstmt:
@@ -271,12 +279,13 @@ static Node *specializenode(Node *n, Htab *tsmap)
r->lit.littype = n->lit.littype;
r->lit.type = tysubst(n->expr.type, tsmap);
switch (n->lit.littype) {
- case Lchr: r->lit.chrval = n->lit.chrval; break;
- case Lint: r->lit.intval = n->lit.intval; break;
- case Lflt: r->lit.fltval = n->lit.fltval; break;
- case Lstr: r->lit.strval = n->lit.strval; break;
- case Llbl: r->lit.lblval = n->lit.lblval; break;
- case Lbool: r->lit.boolval = n->lit.boolval; break;
+ case Ljtab: die("jtab in frontend?"); break;
+ case Lchr: r->lit.chrval = n->lit.chrval; break;
+ case Lint: r->lit.intval = n->lit.intval; break;
+ case Lflt: r->lit.fltval = n->lit.fltval; break;
+ case Lstr: r->lit.strval = n->lit.strval; break;
+ case Llbl: r->lit.lblval = n->lit.lblval; break;
+ case Lbool: r->lit.boolval = n->lit.boolval; break;
case Lfunc: r->lit.fnval = specializenode(n->lit.fnval, tsmap); break;
}
break;