[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()}" }
|
body.commentPreviousInstr { "name: ${field.name}, type: ${field.type.render()}" }
|
||||||
} else {
|
} else {
|
||||||
generateExpression(expression.value)
|
generateExpression(expression.value)
|
||||||
body.buildSetGlobal(context.referenceGlobalField(expression.symbol))
|
body.buildSetGlobal(context.referenceGlobalField(expression.symbol), expression.getSourceLocation())
|
||||||
body.commentPreviousInstr { "type: ${field.type.render()}" }
|
body.commentPreviousInstr { "type: ${field.type.render()}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ abstract class WasmExpressionBuilder {
|
|||||||
buildInstr(WasmOp.GLOBAL_GET, location, WasmImmediate.GlobalIdx(global))
|
buildInstr(WasmOp.GLOBAL_GET, location, WasmImmediate.GlobalIdx(global))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildSetGlobal(global: WasmSymbol<WasmGlobal>) {
|
fun buildSetGlobal(global: WasmSymbol<WasmGlobal>, location: SourceLocation) {
|
||||||
buildInstr(WasmOp.GLOBAL_SET, WasmImmediate.GlobalIdx(global))
|
buildInstr(WasmOp.GLOBAL_SET, location, WasmImmediate.GlobalIdx(global))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildStructGet(struct: WasmSymbol<WasmTypeDeclaration>, fieldId: WasmSymbol<Int>) {
|
fun buildStructGet(struct: WasmSymbol<WasmTypeDeclaration>, fieldId: WasmSymbol<Int>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user