Closed
Bug 617819
Opened 14 years ago
Closed 3 years ago
warning C4789: destination of memory copy is too small in nsCSSScanner.cpp
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: RyanVM, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [build_warning])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
Details | Diff | Splinter Review |
This warning showed up recently on my own builds. Doesn't seem to be showing up on Tinderbox. I do PGO builds with MSVC 2010 with -O2 -GL.
c:\mozbuild\mozilla-central\layout\style\nscssscanner.cpp(736) : warning C4789: destination of memory copy is too small
Reporter | ||
Updated•14 years ago
|
Whiteboard: [build_warning]
Reporter | ||
Comment 1•14 years ago
|
||
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSScanner.cpp?mark=736#721
721 PRBool
722 nsCSSScanner::Next(nsCSSToken& aToken)
...
734 // IDENT
735 if (StartsIdent(ch, Peek()))
736 return ParseIdent(ch, aToken);
Reporter | ||
Comment 2•13 years ago
|
||
This seems to have been tied to the optimization settings I was using. Whatever the reason, it's gone now.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Reporter | ||
Comment 3•13 years ago
|
||
I still see this on MSVC 2010 PGO builds with no optimizations enabled. This looks potentially bad. Maybe a bug with MSVC, but is there a way to mitigate it?
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Reporter | ||
Updated•13 years ago
|
Status: REOPENED → NEW
Comment 4•13 years ago
|
||
What line is the trunk warning on?
Reporter | ||
Comment 5•13 years ago
|
||
Comment 6•13 years ago
|
||
Erm. Line 726 shouldn't have any memory copies....
Reporter | ||
Comment 7•13 years ago
|
||
Dunno, but I just checked again.
c:\mozbuild\mozilla-central\layout\style\nscssscanner.cpp(726) : warning C4789: destination of memory copy is too small
Comment 8•13 years ago
|
||
If you inline ParseIdent at that point manually, which line does it complain on?
Reporter | ||
Comment 9•13 years ago
|
||
Here's what I'm trying now. Will post back in a couple hours with results.
Reporter | ||
Comment 10•13 years ago
|
||
Now it's giving the warning on this line:
if (!GatherIdent(ch, ident)) {
Comment 11•13 years ago
|
||
Alright. Can you try inlining that too?
Reporter | ||
Comment 12•13 years ago
|
||
This is what I'm testing now. I'm pretty sure I did it right, but I would appreciate if you could give it a quick look to make sure I didn't screw something up.
Attachment #583951 -
Attachment is obsolete: true
Comment 13•13 years ago
|
||
Comment on attachment 583987 [details] [diff] [review]
Inline ParseIdent and GatherIdent
Yeah, looks reasonable.
Reporter | ||
Comment 14•13 years ago
|
||
else if (0 < ch) {
>>> ident.Append(ch);
}
Comment 15•13 years ago
|
||
Hrm. And this is a _compile_ time warning???
Reporter | ||
Comment 16•13 years ago
|
||
No, while linking xul.lib on the second pass.
Reporter | ||
Comment 17•13 years ago
|
||
Is there anything more I can do to help move this along?
Comment 18•13 years ago
|
||
I have no idea what's going on here. :( In general, our string append code should.. kinda work. We use it all over....
Reporter | ||
Comment 19•13 years ago
|
||
This also happens with tinderbox PGO builds now that they've been switched over to using VC10.
https://tbpl.mozilla.org/php/getParsedLog.php?id=9016860&tree=Firefox&full=1
Blocks: msvc2010
Updated•13 years ago
|
Blocks: buildwarning
Reporter | ||
Comment 20•13 years ago
|
||
At the risk of shouting more into the Grand Canyon, can someone at least say if this bug is just a nuisance or something worse? This is shipping in nightlies now.
From MSDN:
Warns about buffer overrun when specific C run-time (CRT) functions are used, parameters are passed, and assignments are performed, such that the data sizes are known at compile time. This warning is for situations that might elude typical data-size mismatch detection.
Comment 21•13 years ago
|
||
That's the problem. I wish I could tell what MSVC _thinks_ is going on here.... :(
Reporter | ||
Comment 22•3 years ago
|
||
nsCSSScanner.cpp isn't a thing anymore.
Status: NEW → RESOLVED
Closed: 13 years ago → 3 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•