‘NullPtr’ is ambiguous in ArrayBufferObject.cpp

RESOLVED FIXED in mozilla36

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: stevensn, Assigned: luke)

Tracking

Trunk
mozilla36
Other
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

4 years ago
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
(Reporter)

Comment 1

4 years ago
Created attachment 8507383 [details] [diff] [review]
1084985.diff
Attachment #8507383 - Flags: review?(luke)
(Reporter)

Updated

4 years ago
Summary: ‘NullPtr’ is ambiguous is ArrayBufferObject.cpp → ‘NullPtr’ is ambiguous in ArrayBufferObject.cpp
(Assignee)

Comment 3

4 years ago
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)
(Assignee)

Comment 4

4 years ago
Created attachment 8507890 [details] [diff] [review]
un-using-namespace-JS
Attachment #8507890 - Flags: review?(jorendorff)
(Reporter)

Comment 6

4 years ago
8507890 builds for me
(Assignee)

Comment 7

4 years ago
Created attachment 8508870 [details] [diff] [review]
un-using-namespace-JS

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.
(Assignee)

Updated

4 years ago
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.