Bug 1149495 - SavedFrame objects should handle all uint32 values. r=shu
authorNick Fitzgerald <fitzgen@gmail.com>
Sat, 04 Apr 2015 14:55:00 +0200
changeset 267767 bbe22e6e4e678066980d85ee5d1ebcca41c695f0
parent 267766 3451d72b8e1aa24be59430de427f91abe7eb916b
child 267768 d5efa282fa7f38c9ac741819315d7f049e9cb8f9
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1149495
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1149495 - SavedFrame objects should handle all uint32 values. r=shu
js/src/jit-test/tests/saved-stacks/bug-1149495.js
js/src/vm/SavedStacks.cpp
new file mode 100644
--- /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"
+}
--- a/js/src/vm/SavedStacks.cpp
+++ b/js/src/vm/SavedStacks.cpp
@@ -246,24 +246,24 @@ SavedFrame::getSource()
     JSString* s = v.toString();
     return &s->asAtom();
 }
 
 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*
 SavedFrame::getFunctionDisplayName()
 {
     const Value& v = getReservedSlot(JSSLOT_FUNCTIONDISPLAYNAME);
     if (v.isNull())
         return nullptr;
@@ -299,18 +299,18 @@ SavedFrame::getPrincipals()
 
 void
 SavedFrame::initFromLookup(SavedFrame::HandleLookup lookup)
 {
     MOZ_ASSERT(lookup->source);
     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)
                         : NullValue());
     setReservedSlot(JSSLOT_ASYNCCAUSE,
                     lookup->asyncCause
                         ? StringValue(lookup->asyncCause)
                         : NullValue());