mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-13 05:21:51 +00:00
Fix issues with more than 64 locals, see #99
This commit is contained in:
@ -2008,8 +2008,10 @@ export class Compiler extends DiagnosticEmitter {
|
||||
}
|
||||
if (initExpr) {
|
||||
initializers.push(this.compileAssignmentWithValue(declaration.name, initExpr));
|
||||
flow.setLocalWrapped(local.index, !flow.canOverflow(initExpr, type));
|
||||
} else {
|
||||
if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {
|
||||
flow.setLocalWrapped(local.index, !flow.canOverflow(initExpr, type));
|
||||
}
|
||||
} else if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {
|
||||
flow.setLocalWrapped(local.index, true); // zero
|
||||
}
|
||||
}
|
||||
@ -4418,7 +4420,9 @@ export class Compiler extends DiagnosticEmitter {
|
||||
return module.createUnreachable();
|
||||
}
|
||||
let flow = this.currentFunction.flow;
|
||||
flow.setLocalWrapped((<Local>target).index, !flow.canOverflow(valueWithCorrectType, type));
|
||||
if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {
|
||||
flow.setLocalWrapped((<Local>target).index, !flow.canOverflow(valueWithCorrectType, type));
|
||||
}
|
||||
return tee
|
||||
? module.createTeeLocal((<Local>target).index, valueWithCorrectType)
|
||||
: module.createSetLocal((<Local>target).index, valueWithCorrectType);
|
||||
|
Reference in New Issue
Block a user