[Wasm] Require location for buildRefTestStatic and fix all usages
This commit is contained in:
+2
-1
@@ -484,7 +484,8 @@ class BodyGenerator(
|
|||||||
private fun generateRefTest(fromType: IrType, toType: IrType, location: SourceLocation) {
|
private fun generateRefTest(fromType: IrType, toType: IrType, location: SourceLocation) {
|
||||||
if (!isDownCastAlwaysSuccessInRuntime(fromType, toType)) {
|
if (!isDownCastAlwaysSuccessInRuntime(fromType, toType)) {
|
||||||
body.buildRefTestStatic(
|
body.buildRefTestStatic(
|
||||||
toType = context.referenceGcType(toType.getRuntimeClass(irBuiltIns).symbol)
|
toType = context.referenceGcType(toType.getRuntimeClass(irBuiltIns).symbol),
|
||||||
|
location
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
body.buildDrop()
|
body.buildDrop()
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ abstract class WasmExpressionBuilder {
|
|||||||
buildInstr(WasmOp.REF_CAST_DEPRECATED, location, WasmImmediate.TypeIdx(toType))
|
buildInstr(WasmOp.REF_CAST_DEPRECATED, location, WasmImmediate.TypeIdx(toType))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildRefTestStatic(toType: WasmSymbolReadOnly<WasmTypeDeclaration>) {
|
fun buildRefTestStatic(toType: WasmSymbolReadOnly<WasmTypeDeclaration>, location: SourceLocation) {
|
||||||
buildInstr(WasmOp.REF_TEST_DEPRECATED, WasmImmediate.TypeIdx(toType))
|
buildInstr(WasmOp.REF_TEST_DEPRECATED, location, WasmImmediate.TypeIdx(toType))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildRefNull(type: WasmHeapType) {
|
fun buildRefNull(type: WasmHeapType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user