Closed Bug 115124 Opened 23 years ago Closed 23 years ago

###!!! ASSERTION: Can't use |Truncate()| to make a string longer.: 'aNewLength <= this->Length()', file ../../dist/include/string/nsAString.h, line 506

Categories

(Core :: XBL, defect)

x86
FreeBSD
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: hyatt)

Details

(Keywords: assertion)

Attachments

(1 file)

#6  0x282ce615 in nsACString::Truncate (this=0xbfbfd69c, aNewLength=4294967295) at ../../dist/include/string/nsAString.h:506
#7  0x292f1a31 in nsXBLService::GetBindingInternal (this=0x81e0b80, aBoundElement=0x880bbc0, aURLStr=@0xbfbfd914, aPeekOnly=0, aIsReady=0xbfbfd73c, aResult=0xbfbfd980)
    at /home/timeless/mozilla/content/xbl/src/nsXBLService.cpp:938

Tingley pointed out that aNewLength is -1.

#7  0x292f1a31 in nsXBLService::GetBindingInternal (this=0x81e0b80, aBoundElement=0x880bbc0, aURLStr=@0xbfbfd914, aPeekOnly=0, aIsReady=0xbfbfd73c, aResult=0xbfbfd980)
    at /home/timeless/mozilla/content/xbl/src/nsXBLService.cpp:938
938       uri.Truncate(indx);
(gdb) list
933       // XXX Obtain the # marker and remove it from the URL.
934       nsCAutoString uri(aURLStr);
935       PRInt32 indx = uri.RFindChar('#');
936       nsCAutoString ref;
937       uri.Right(ref, uri.Length() - (indx + 1));
938       uri.Truncate(indx);
939
940       nsCOMPtr<nsIDocument> boundDocument;
941       aBoundElement->GetDocument(*getter_AddRefs(boundDocument));
942
uri doesn't contain '#'
Comment on attachment 61624 [details] [diff] [review]
if # isn't found, return error

please ignore the second block. i've been typoing near xbl a bit so the number
of outstanding patches to it is growing.
Keywords: assertion
Comment on attachment 61624 [details] [diff] [review]
if # isn't found, return error

r=pink
Attachment #61624 - Flags: review+
Comment on attachment 61624 [details] [diff] [review]
if # isn't found, return error

sr=alecf
Attachment #61624 - Flags: superreview+
Comment on attachment 61624 [details] [diff] [review]
if # isn't found, return error

spaces around operators, please (as the prevailing style does, and as Mozilla
style almost always does).

Fix that, and a=brendan@mozilla.org
Keywords: mozilla0.9.7
fix checked in with spaces
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: