summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-08-01 11:56:43 -0700
committerGitHub <noreply@github.com>2024-08-01 11:56:43 -0700
commit705c28d3a33d606c8c938d079dbf82de7e7a6b7d (patch)
treed1883b48ff32ffab2b88a0ac59c8ca6d4e423608
parentc68978114ccb12a6cef8ba5651ef3e0deb03f879 (diff)
downloadbinaryen-705c28d3a33d606c8c938d079dbf82de7e7a6b7d.tar.gz
binaryen-705c28d3a33d606c8c938d079dbf82de7e7a6b7d.tar.bz2
binaryen-705c28d3a33d606c8c938d079dbf82de7e7a6b7d.zip
[NFC] Avoid a temp local (#6800)
The local was only used once, so it didn't really add much. And, it was causing some compilers to error on "unused variable" (when building without assertions, the use was removed).
-rw-r--r--src/wasm/literal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 7e4aeb8c7..f2100ea71 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -2702,9 +2702,9 @@ Literal Literal::externalize() const {
Literal Literal::internalize() const {
auto share = type.getHeapType().getShared();
- auto extType = HeapTypes::ext.getBasic(share);
- assert(Type::isSubType(type, Type(extType, Nullable)) &&
- "can only internalize external references");
+ assert(
+ Type::isSubType(type, Type(HeapTypes::ext.getBasic(share), Nullable)) &&
+ "can only internalize external references");
if (isNull()) {
return Literal(std::shared_ptr<GCData>{}, HeapTypes::none.getBasic(share));
}