Closed Bug 994181 Opened 5 years ago Closed 5 years ago

TraceLogger: compile error with gcc 4.8.1 on x64 platforms

Categories

(Core :: JavaScript Engine, defect)

x86_64
All
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: bbouvier, Assigned: bbouvier)

References

Details

Attachments

(1 file)

In file included from /home/ben/code/moz/builds/tld64/js/src/Unified_cpp_js_src2.cpp:184:0:
/home/ben/code/moz/inbound/js/src/jit/CodeGenerator.cpp: In member function ‘bool js::jit::CodeGenerator::link(JSContext*, js::types::CompilerConstraintList*)’:
/home/ben/code/moz/inbound/js/src/jit/CodeGenerator.cpp:6498:59: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
                                            ImmPtr((void *)scriptId),

I am kind of amazed it didn't bite you when you compiled it.
scriptId is 32 bits, a pointer on x64 is 64 bits. The naive fix would be to cast the scriptId into a uintptr_t before casting it into a void*. A better fix would be to see whether we can use patchWrite_Imm32, as we're writing an immediate and not a pointer at this location.
Attached patch bug994181.patchSplinter Review
That makes it compile locally
Attachment #8404604 - Flags: review?(hv1989)
Attachment #8404604 - Flags: review?(hv1989) → review+
https://hg.mozilla.org/mozilla-central/rev/67924d0de192
Assignee: nobody → benj
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.