Closed Bug 189295 Opened 22 years ago Closed 22 years ago

nsTextFrame.cpp: The variable isWhitespace has not yet been assigned a value.

Categories

(Core :: Layout, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.3beta

People

(Reporter: roland.mainz, Assigned: roland.mainz)

References

()

Details

Attachments

(1 file)

While compiling 2003-01-15-08-trunk on Solaris/SPARC I saw the following compiler warning in the log: -- snip -- ... "../../../../../../../../../home/mozilla/src/2003-01-15-08-trunk/mozilla/layout/html/base/src/nsTextFrame.cpp", line 4845: Warning: The variable isWhitespace has not yet been assigned a value. 1 Warning(s) detected. -- snip -- Looking at the matching code: -- snip -- 4842 } 4843 } 4844 #endif // IBMBIDI 4845 // Get next word/whitespace from the text 4846 PRBool isWhitespace, wasTransformed; 4847 PRInt32 wordLen, contentLen; 4848 union { 4849 char* bp1; 4850 PRUnichar* bp2; 4851 }; 4852 #ifdef IBMBIDI 4853 wordLen = start; 4854 #endif // IBMBIDI 4855 4856 // We need to set aTextData.mCanBreakBefore to true after 1st word. But we can't set 4857 // aTextData.mCanBreakBefore without seeing the 2nd word. That's because this frame 4858 // may only contain part of one word, the other part is in next frame. 4859 // we don't care if first word is whitespace, that will be addressed later. 4860 if (!aTextData.mCanBreakBefore && !firstThing && !isWhitespace) { 4861 firstWordDone = PR_TRUE; 4862 } 4863 4864 bp2 = aTx.GetNextWord(aTextData.mInWord, &wordLen, &contentLen, &isWhitespace, 4865 &wasTransformed, textRun.mNumSegments == 0); 4866 #ifdef IBMBIDI 4867 if (nextBidi) { 4868 mContentLength -= contentLen; 4869 -- snip -- ... this can't be correct - |isWhitespace| is a random value from stack in this case...;-(
CC:'ing some people per CVSblame...
Yeah, that looks totally wrong. Shouldn't that check come after the bp2 = aTx.GetNextWord(aTextData.mInWord, &wordLen, &contentLen, &isWhitespace, &wasTransformed, textRun.mNumSegments == 0); call?
Assignee: misc → shanjian
Flags: blocking1.3b?
Not essential for 1.3beta. I agree with boris, just move the check. Roland, if you make the patch I'll review it for you.
Flags: blocking1.3b? → blocking1.3b-
Taking... suffering is all mine... ;-/
Assignee: shanjian → Roland.Mainz
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.3beta
Attachment #113447 - Flags: superreview?(roc+moz)
Attachment #113447 - Flags: review?(smontagu)
Comment on attachment 113447 [details] [diff] [review] Patch for 2003-01-20-08-trunk I would be much happier if shanjian could sign off on this change.
Attachment #113447 - Flags: review?(smontagu) → review?(shanjian)
Attachment #113447 - Flags: superreview?(roc+moz) → superreview+
Comment on attachment 113447 [details] [diff] [review] Patch for 2003-01-20-08-trunk Moving r=-request over to rbs@maths.uq.edu.au per discussion with smontagu...
Attachment #113447 - Flags: review?(shanjian) → review?(rbs)
Attachment #113447 - Flags: review?(rbs) → review+
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment on attachment 113447 [details] [diff] [review] Patch for 2003-01-20-08-trunk Requesting a= for 1.3final branch. The patch is pretty much low-risk since the previous behaviour was "random" (based on use of an uninitalised variable), now we (at least) use a initalised value, e.g. we can't do things much wrong. And the patch seems to fix the issue that sometimes whitespaces are missing and textisrenderedwithoutspacesmakingtexthardtoread... :)
Attachment #113447 - Flags: approval1.3?
Keywords: mozilla1.3
Comment on attachment 113447 [details] [diff] [review] Patch for 2003-01-20-08-trunk 1.3.1 is done. this didn't make it.
Attachment #113447 - Flags: approval1.3?
Product: Core → Core Graveyard
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: