summaryrefslogtreecommitdiff
path: root/lib/ObjectYAML
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r--lib/ObjectYAML/WasmYAML.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ObjectYAML/WasmYAML.cpp b/lib/ObjectYAML/WasmYAML.cpp
index 3e1bed19d61fe..9b1ff7e5dc167 100644
--- a/lib/ObjectYAML/WasmYAML.cpp
+++ b/lib/ObjectYAML/WasmYAML.cpp
@@ -223,7 +223,7 @@ void MappingTraits<WasmYAML::Relocation>::mapping(
IO.mapRequired("Type", Relocation.Type);
IO.mapRequired("Index", Relocation.Index);
IO.mapRequired("Offset", Relocation.Offset);
- IO.mapRequired("Addend", Relocation.Addend);
+ IO.mapOptional("Addend", Relocation.Addend, 0);
}
void MappingTraits<WasmYAML::LocalDecl>::mapping(
@@ -294,6 +294,9 @@ void MappingTraits<wasm::WasmInitExpr>::mapping(IO &IO,
case wasm::WASM_OPCODE_F64_CONST:
IO.mapRequired("Value", Expr.Value.Float64);
break;
+ case wasm::WASM_OPCODE_GET_GLOBAL:
+ IO.mapRequired("Index", Expr.Value.Global);
+ break;
}
}