Bug 6288 - HEAD build broken 12/29/2005
Summary: HEAD build broken 12/29/2005
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Blocker
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-29 12:50 PST by Mark Dalrymple
Modified: 2005-12-29 23:08 PST (History)
0 users

See Also:


Attachments
Fetch previous character from the buffer instead of using uninitialized ch (1.69 KB, patch)
2005-12-29 13:48 PST, mitz
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Dalrymple 2005-12-29 12:50:33 PST
MacDome on IRC suggested I submit this as a bug.

I did a fresh webkit checkout and build.  I received these errors:

cc1obj: warnings being treated as errors
/Users/mdalrymple/Projects/webkit/WebKit/WebCoreSupport.subproj/WebTextRenderer.m: In function 
'overrideLayoutOperation':
/Users/mdalrymple/Projects/webkit/WebKit/WebCoreSupport.subproj/WebTextRenderer.m:242: 
warning: 'ch' may be used uninitialized \
in this function
{standard input}:4536:non-relocatable subtraction expression, "_overrideLayoutOperation" minus 
"L00000000015$pb"
{standard input}:4536:symbol: "_overrideLayoutOperation" can't be undefined in a subtraction 
expression
{standard input}:4530:non-relocatable subtraction expression, "_overrideLayoutOperation" minus 
"L00000000015$pb"
{standard input}:4530:symbol: "_overrideLayoutOperation" can't be undefined in a subtraction 
expression
** BUILD FAILED **

By hacking the file locally and setting 'ch = 0' on line 242 lets the compile progress past this point.
Comment 1 Eric Seidel (no email) 2005-12-29 12:51:27 PST
Caused by:
http://bugzilla.opendarwin.org/show_bug.cgi?id=3922
Comment 2 mitz 2005-12-29 13:10:03 PST
Sorry!

I think ch shouldn't be used there, but rather the check should be
                    if (offset != 0 && !isSpace(*(UniChar *)(((char *)characters) + offset - 1)) && style-
>wordSpacing)

I'm going to compile and test this change right away.
Comment 3 mitz 2005-12-29 13:48:05 PST
Created attachment 5356 [details]
Fetch previous character from the buffer instead of using uninitialized ch

The funny pointer math is required because offset is given in bytes, and I
think it's neater to use "-1" rather than "-2" since it's 1 UniChar behind.
Comment 4 Eric Seidel (no email) 2005-12-29 14:11:34 PST
Comment on attachment 5356 [details]
Fetch previous character from the buffer instead of using uninitialized ch

Yes, this fixes the bug.  And I'll trust mitz on the correctness of the logic
here.  r=me.