[Wasm] Require location for buildSetGlobal and fix all usages
This commit is contained in:
+1
-1
@@ -229,7 +229,7 @@ class BodyGenerator(
|
||||
body.commentPreviousInstr { "name: ${field.name}, type: ${field.type.render()}" }
|
||||
} else {
|
||||
generateExpression(expression.value)
|
||||
body.buildSetGlobal(context.referenceGlobalField(expression.symbol))
|
||||
body.buildSetGlobal(context.referenceGlobalField(expression.symbol), expression.getSourceLocation())
|
||||
body.commentPreviousInstr { "type: ${field.type.render()}" }
|
||||
}
|
||||
|
||||
|
||||
@@ -141,8 +141,8 @@ abstract class WasmExpressionBuilder {
|
||||
buildInstr(WasmOp.GLOBAL_GET, location, WasmImmediate.GlobalIdx(global))
|
||||
}
|
||||
|
||||
fun buildSetGlobal(global: WasmSymbol<WasmGlobal>) {
|
||||
buildInstr(WasmOp.GLOBAL_SET, WasmImmediate.GlobalIdx(global))
|
||||
fun buildSetGlobal(global: WasmSymbol<WasmGlobal>, location: SourceLocation) {
|
||||
buildInstr(WasmOp.GLOBAL_SET, location, WasmImmediate.GlobalIdx(global))
|
||||
}
|
||||
|
||||
fun buildStructGet(struct: WasmSymbol<WasmTypeDeclaration>, fieldId: WasmSymbol<Int>) {
|
||||
|
||||
Reference in New Issue
Block a user