WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
91981
Ref-count AtomicHTMLToken
https://bugs.webkit.org/show_bug.cgi?id=91981
Summary
Ref-count AtomicHTMLToken
Kwang Yul Seo
Reported
2012-07-23 04:22:30 PDT
To avoid copying AtomicHTMLToken in
Bug 91703
, AtomicHTMLToken needs to be ref-counted.
Attachments
Patch
(108.27 KB, patch)
2012-07-23 04:30 PDT
,
Kwang Yul Seo
abarth
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Kwang Yul Seo
Comment 1
2012-07-23 04:30:30 PDT
Created
attachment 153772
[details]
Patch
Adam Barth
Comment 2
2012-07-23 09:20:22 PDT
Comment on
attachment 153772
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=153772&action=review
Thanks for splitting this out into a separate patch. The only concern I have with this patch is that AtomicHTMLToken has an external character buffer. If we retain the atomic token too long, then that will point to garbage memory.
> Source/WebCore/html/parser/HTMLToken.h:105 > + AtomicHTMLToken(HTMLToken& token) : AtomicMarkupTokenBase<HTMLToken>(&token) { }
This should be split onto four lines like the other constructor.
> Source/WebCore/html/parser/HTMLTreeBuilder.cpp:436 > - AtomicHTMLToken token(rawToken); > + RefPtr<AtomicHTMLToken> token = AtomicHTMLToken::create(rawToken);
I wonder if we should clear the external character buffer pointers at the end of this function... That way we won't risk having any dangling pointers. Would you be willing to post a follow up patch that tries that?
Kwang Yul Seo
Comment 3
2012-07-23 14:59:20 PDT
(In reply to
comment #2
)
> > Source/WebCore/html/parser/HTMLToken.h:105 > > + AtomicHTMLToken(HTMLToken& token) : AtomicMarkupTokenBase<HTMLToken>(&token) { } > > This should be split onto four lines like the other constructor.
Okay. I will change it when I land the patch.
> > Source/WebCore/html/parser/HTMLTreeBuilder.cpp:436 > > - AtomicHTMLToken token(rawToken); > > + RefPtr<AtomicHTMLToken> token = AtomicHTMLToken::create(rawToken); > > I wonder if we should clear the external character buffer pointers at the end of this function... That way we won't risk having any dangling pointers. Would you be willing to post a follow up patch that tries that?
Sure, I will file a bug. We keep only the start tag tokens in the element stack and the list of active formatting elements , so there is no dangling pointer in the current code paths. But I agree that we need to make sure this, so we won't accidentally have dangling pointers later.
Kwang Yul Seo
Comment 4
2012-07-23 15:02:29 PDT
Committed
r123389
: <
http://trac.webkit.org/changeset/123389
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug