summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r--src/wasm/literal.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index eb28268fb..6b63d2ca5 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -196,6 +196,17 @@ int64_t Literal::getInteger() const {
}
}
+uint64_t Literal::getUnsigned() const {
+ switch (type.getBasic()) {
+ case Type::i32:
+ return static_cast<uint32_t>(i32);
+ case Type::i64:
+ return i64;
+ default:
+ abort();
+ }
+}
+
double Literal::getFloat() const {
switch (type.getBasic()) {
case Type::f32: