Browse Source

Fix Offset referenced by an iteger

master
Jordi Baylina 3 years ago
parent
commit
2e1b35a94d
No known key found for this signature in database GPG Key ID: 7480C80C1BE43112
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/gencode.js

+ 9
- 1
src/gencode.js

@ -723,7 +723,15 @@ function genVarAssignment(ctx, ast, lRef, sels, rRef) {
if (instantiated) {
if (offset.used) {
ctx.codeBuilder.copyN(left.label, ["R", offset.label], ["R", right.label], right.sizes[0]);
let ot;
if (offset.type == "BIGINT") {
ot = "R";
} else if (offset.type == "INT") {
ot= "RI";
} else {
assert(false);
}
ctx.codeBuilder.copyN(left.label, [ot, offset.label], ["R", right.label], right.sizes[0]);
} else {
ctx.codeBuilder.copyN(left.label, ["V", offset.value[0]], ["R", right.label], right.sizes[0]);
}

Loading…
Cancel
Save