From a8f29286f99b8cde3dbb4656d5ac24a0ec2bdf5c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 23 Dec 2015 16:19:57 -0800 Subject: ensure proper literal type for popcnt results --- src/wasm-interpreter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wasm-interpreter.h') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 7752f5356..012c1c347 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -368,7 +368,7 @@ private: if (v == 0) return Literal(32); return Literal(CountTrailingZeroes((uint32_t)v)); } - case Popcnt: return Literal(PopCount((uint32_t)v)); + case Popcnt: return Literal((int32_t)PopCount((uint32_t)v)); case ReinterpretInt: { float v = value.reinterpretf32(); if (isnan(v)) { @@ -397,7 +397,7 @@ private: if (low == 0) return Literal(32+(int64_t)CountTrailingZeroes((uint32_t)high)); return Literal((int64_t)CountTrailingZeroes((uint32_t)low)); } - case Popcnt: return Literal(PopCount((uint64_t)v)); + case Popcnt: return Literal((int64_t)PopCount((uint64_t)v)); case WrapInt64: return Literal(int32_t(value.geti64())); case ReinterpretInt: { return Literal(value.reinterpretf64()); -- cgit v1.2.3