Closed Bug 1084985 Opened 10 years ago Closed 10 years ago

‘NullPtr’ is ambiguous in ArrayBufferObject.cpp

Categories

(Core :: JavaScript Engine: JIT, defect)

Other
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: stevensn, Assigned: luke)

References

Details

Attachments

(2 files, 1 obsolete file)

Bug 1081379 introduced some calls ArrayBufferObject.cpp to NullPtr() instead of js::NullPtr that is causing a compile error on my non-tier 1 platform (non-ion, sps profiler disabled)



2:59.76 /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/vm/ArrayBufferObject.cpp: In function ‘JSObj
ect* js_InitArrayBufferClass(JSContext*, JS::HandleObject)’:
 2:59.76 /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/vm/ArrayBufferObject.cpp:1290:40: error: ref
erence to ‘NullPtr’ is ambiguous
 2:59.76      JSObject *getter = NewFunction(cx, NullPtr(), ArrayBufferObject::byteLengthGetter, 0,
 2:59.76                                         ^
 2:59.76 In file included from ../../dist/include/js/CallArgs.h:38:0,
 2:59.76                  from ../../dist/include/js/CallNonGenericMethod.h:12,
 2:59.76                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/NamespaceImports.h:15,
 2:59.76                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/gc/Barrier.h:10,
 2:59.76                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jsatom.h:14,
 2:59.76                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/vm/Runtime.h:21,
 2:59.76                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jscntxt.h:15,
 2:59.76                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/vm/RegExpObject.h:13,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/builtin/RegExp.h:10,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jscompartment.h:12,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jsweakmap.h:10,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jsweakmap.cpp:7,
 2:59.77                  from /home/ssinger/build-out.ppc64/js/src/Unified_cpp_js_src8.cpp:2:
 2:59.77 ../../dist/include/js/RootingAPI.h:165:8: note: candidates are: struct JS::NullPtr
 2:59.77  struct JS_PUBLIC_API(NullPtr)
2:59.77         ^
 2:59.77 In file included from ../../dist/include/js/CallArgs.h:38:0,
 2:59.77                  from ../../dist/include/js/CallNonGenericMethod.h:12,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/NamespaceImports.h:15,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/gc/Barrier.h:10,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jsatom.h:14,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/vm/Runtime.h:21,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jscntxt.h:15,
 2:59.77                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/vm/RegExpObject.h:13,
 2:59.78                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/builtin/RegExp.h:10,
 2:59.78                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jscompartment.h:12,
 2:59.78                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jsweakmap.h:10,
 2:59.78                  from /media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/js/src/jsweakmap.cpp:7,
 2:59.78                  from /home/ssinger/build-out.ppc64/js/src/Unified_cpp_js_src8.cpp:2:
 2:59.78 ../../dist/include/js/RootingAPI.h:135:8: note:                 struct js::NullPtr
 2:59.78  struct NullPtr
Attached patch 1084985.diffSplinter Review
Attachment #8507383 - Flags: review?(luke)
Summary: ‘NullPtr’ is ambiguous is ArrayBufferObject.cpp → ‘NullPtr’ is ambiguous in ArrayBufferObject.cpp
Comment on attachment 8507383 [details] [diff] [review]
1084985.diff

I think the root problem here is that some other .cpp that is unified with this one is 'using namespace JS', which it is not supposed to do.  Patch shortly.
Attachment #8507383 - Flags: review?(luke)
Attached patch un-using-namespace-JS (obsolete) — Splinter Review
Attachment #8507890 - Flags: review?(jorendorff)
8507890 builds for me
4 tweaks later and try is green.
Attachment #8507890 - Attachment is obsolete: true
Attachment #8507890 - Flags: review?(jorendorff)
Attachment #8508870 - Flags: review?(jorendorff)
I'm getting compile errors on Mac OS X (10.9.5) because of this, I'm mystified that nobody else is seeing that.  Both debug and release builds.

build-debug$ /usr/bin/clang++ --version
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Aha, the reason is that my patch introduces new files that perturb the unified files, hence makes the problem visible on Mac OS X.

The proposed patch fixes the compile problem even with my patch present.
Attachment #8508870 - Flags: review?(jorendorff) → review?(lhansen)
Comment on attachment 8508870 [details] [diff] [review]
un-using-namespace-JS

Review of attachment 8508870 [details] [diff] [review]:
-----------------------------------------------------------------

Sure.  My try run using this patch underneath my patch had no compile errors.
Attachment #8508870 - Flags: review?(lhansen) → review+
https://hg.mozilla.org/mozilla-central/rev/2f89fb9b6aba
Assignee: nobody → luke
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: