Commit a53c1e4b authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][fuzzer] Support functions returning i64

Those functions will return a BigInt, which we need to convert to int to
match the value returned by the interpreter.

R=ahaas@chromium.org

Bug: chromium:1127717
Change-Id: I328660ab73776de2bd90b19d18e46663efe6b6cb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2412177Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69922}
parent a97af0b5
......@@ -210,7 +210,7 @@ class BigInt : public BigIntBase {
static MaybeHandle<BigInt> FromWords64(Isolate* isolate, int sign_bit,
int words64_count,
const uint64_t* words);
int64_t AsInt64(bool* lossless = nullptr);
V8_EXPORT_PRIVATE int64_t AsInt64(bool* lossless = nullptr);
uint64_t AsUint64(bool* lossless = nullptr);
int Words64Count();
void ToWordsArray64(int* sign_bit, int* words64_count, uint64_t* words);
......
......@@ -231,6 +231,9 @@ int32_t CallWasmFunctionForTesting(Isolate* isolate,
if (result->IsHeapNumber()) {
return static_cast<int32_t>(HeapNumber::cast(*result).value());
}
if (result->IsBigInt()) {
return static_cast<int32_t>(BigInt::cast(*result).AsInt64());
}
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment