From 30234ac43b37cfdf1ec7a5554128d39a0e3b06fc Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Sat, 4 Apr 2015 14:55:00 +0200 Subject: [PATCH] Bug 1149495 - SavedFrame objects should handle all uint32 values. r=shu --HG-- extra : rebase_source : 3a6982dab6b8c61b590fe3aac61f216c7c4a615c --- js/src/jit-test/tests/saved-stacks/bug-1149495.js | 6 ++++++ js/src/vm/SavedStacks.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 js/src/jit-test/tests/saved-stacks/bug-1149495.js diff --git a/js/src/jit-test/tests/saved-stacks/bug-1149495.js b/js/src/jit-test/tests/saved-stacks/bug-1149495.js new file mode 100644 index 000000000000..aedd7726d6ef --- /dev/null +++ b/js/src/jit-test/tests/saved-stacks/bug-1149495.js @@ -0,0 +1,6 @@ +try { + offThreadCompileScript('Error()', { lineNumber: (4294967295)}); + runOffThreadScript().stack; +} catch (e) { + // Ignore "Error: Can't use offThreadCompileScript with --no-threads" +} diff --git a/js/src/vm/SavedStacks.cpp b/js/src/vm/SavedStacks.cpp index b86a590ea8f7..9860408d2d84 100644 --- a/js/src/vm/SavedStacks.cpp +++ b/js/src/vm/SavedStacks.cpp @@ -251,14 +251,14 @@ uint32_t SavedFrame::getLine() { const Value& v = getReservedSlot(JSSLOT_LINE); - return v.toInt32(); + return v.toPrivateUint32(); } uint32_t SavedFrame::getColumn() { const Value& v = getReservedSlot(JSSLOT_COLUMN); - return v.toInt32(); + return v.toPrivateUint32(); } JSAtom* @@ -304,8 +304,8 @@ SavedFrame::initFromLookup(SavedFrame::HandleLookup lookup) MOZ_ASSERT(getReservedSlot(JSSLOT_SOURCE).isUndefined()); setReservedSlot(JSSLOT_SOURCE, StringValue(lookup->source)); - setReservedSlot(JSSLOT_LINE, NumberValue(lookup->line)); - setReservedSlot(JSSLOT_COLUMN, NumberValue(lookup->column)); + setReservedSlot(JSSLOT_LINE, PrivateUint32Value(lookup->line)); + setReservedSlot(JSSLOT_COLUMN, PrivateUint32Value(lookup->column)); setReservedSlot(JSSLOT_FUNCTIONDISPLAYNAME, lookup->functionDisplayName ? StringValue(lookup->functionDisplayName)