Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: runtime/lib/integers.cc

Issue 2708213004: Introduce a flag --limit-ints-to-64-bits in the VM in order to investigate the (Closed)
Patch Set: work in progress Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/exceptions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/integers.cc
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index 36241789153360801feaaf5db8a11c36d2238eb9..a3fdc274f2b0f6eeb6a88bd0f180dc3f90ac81ea 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -409,6 +409,12 @@ DEFINE_NATIVE_ENTRY(Bigint_getDigits, 1) {
DEFINE_NATIVE_ENTRY(Bigint_allocate, 4) {
+ if (FLAG_limit_ints_to_64_bits) {
+ // The allocated Bigint value is not necessarily out of range, but it may
+ // be used as an operand in an operation resulting in a Bigint.
+ Exceptions::ThrowRangeErrorMsg(
+ "Integer operand requires conversion to Bigint");
+ }
// First arg is null type arguments, since class Bigint is not parameterized.
const Bool& neg = Bool::CheckedHandle(arguments->NativeArgAt(1));
const Smi& used = Smi::CheckedHandle(arguments->NativeArgAt(2));
« no previous file with comments | « no previous file | runtime/vm/exceptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698