Bug 12603 - A crash when trying to use XPath functions normalize-space() and string-length()
Summary: A crash when trying to use XPath functions normalize-space() and string-length()
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Alexey Proskuryakov
Keywords: InRadar
Depends on:
Reported: 2007-02-04 11:46 PST by Alexey Proskuryakov
Modified: 2007-02-07 11:08 PST (History)
0 users

See Also:

test case (875 bytes, text/html)
2007-02-04 11:48 PST, Alexey Proskuryakov
no flags Details
proposed fix (5.24 KB, patch)
2007-02-07 10:52 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2007-02-04 11:46:44 PST
That's the punishment for using a manually written tokenizer!
Comment 1 Alexey Proskuryakov 2007-02-04 11:48:02 PST
Created attachment 12921 [details]
test case

This test is also used for bug 12602 (with two offending cases commented out).
Comment 2 Maciej Stachowiak 2007-02-06 23:25:23 PST
Comment 3 Alexey Proskuryakov 2007-02-07 10:43:51 PST
Actually, the tokenizer is OK - it's just another problem with implicit arguments in these functions (and in number()).
Comment 4 Alexey Proskuryakov 2007-02-07 10:52:07 PST
Created attachment 13011 [details]
proposed fix
Comment 5 mitz 2007-02-07 10:56:00 PST
Per the style guidelines,
+    if (argCount() == 0)
should be rewritten as
+    if (!argCount())

Comment 6 Darin Adler 2007-02-07 11:02:19 PST
Comment on attachment 13011 [details]
proposed fix

Comment 7 Alexey Proskuryakov 2007-02-07 11:08:19 PST
Committed revision 19467.

(In reply to comment #5)
> Per the style guidelines,

Fixed here and in several other places in the file. /me stabs this guideline.