The default bug view has changed. See this FAQ.

Use nsCRTGlue rather than nsCRT in nsStyleStruct.cpp

RESOLVED FIXED in mozilla7

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Joe Drew (not getting mail), Assigned: Joe Drew (not getting mail))

Tracking

Trunk
mozilla7
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 540677 [details] [diff] [review]
use nsCRTGlue

nsCRT::free gets screwed by mozalloc because there are various #undefs and #defines of free. Let's use nsCRTGlue in nsStyleStruct.cpp instead, so we can compile even if free gets #undefed from under us.
Attachment #540677 - Flags: review?(dbaron)
Comment on attachment 540677 [details] [diff] [review]
use nsCRTGlue

r=dbaron
Attachment #540677 - Flags: review?(dbaron) → review+
(Assignee)

Comment 2

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/2783e9b15954
Assignee: nobody → joe
Whiteboard: [inbound]
Backed out due to orange, see:
http://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=2783e9b15954
Whiteboard: [inbound]
Problem looks to be that nsCRT::strcmp is null-safe but NS_strcmp is not.  nsStyleContentData::operator== depends on the null-safety.
(Assignee)

Comment 5

6 years ago
Created attachment 540864 [details] [diff] [review]
v2: wrap strcmp in null-checks

This makes the tests that crashed on mozilla-incoming (sorry sorry sorry) pass on my local machine. I've pushed this to try.
Attachment #540677 - Attachment is obsolete: true
Attachment #540864 - Flags: review?
(Assignee)

Updated

6 years ago
Attachment #540864 - Flags: review? → review?(dbaron)
Comment on attachment 540864 [details] [diff] [review]
v2: wrap strcmp in null-checks

I think we need safe_strcmp only in the second place you're using it, but you should test that :-)

r=dbaron with that
Attachment #540864 - Flags: review?(dbaron) → review+
But I think you should do b-a rather than a-b.
(Assignee)

Comment 8

6 years ago
(In reply to comment #7)
> But I think you should do b-a rather than a-b.

To be clear, I just copied what PL_strcmp does. I don't care which I use :)
Er, sorry, a-b is correct.
(except that it doesn't work if the pointers are in the upper half of the integer space... but it doesn't really matter in this case)
(Assignee)

Comment 11

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/053ac4368a79
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/053ac4368a79
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla7
You need to log in before you can comment on or make changes to this bug.