Bug 191193 - Metadata should not be copyable
Summary: Metadata should not be copyable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tadeu Zagallo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-02 08:03 PDT by Tadeu Zagallo
Modified: 2018-11-04 20:51 PST (History)
7 users (show)

See Also:


Attachments
Patch (3.75 KB, patch)
2018-11-02 08:07 PDT, Tadeu Zagallo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tadeu Zagallo 2018-11-02 08:03:45 PDT
...
Comment 1 Tadeu Zagallo 2018-11-02 08:07:07 PDT
Created attachment 353702 [details]
Patch
Comment 2 Keith Miller 2018-11-02 08:09:26 PDT
r=me.
Comment 3 WebKit Commit Bot 2018-11-02 08:47:04 PDT
Comment on attachment 353702 [details]
Patch

Clearing flags on attachment: 353702

Committed r237734: <https://trac.webkit.org/changeset/237734>
Comment 4 WebKit Commit Bot 2018-11-02 08:47:06 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2018-11-02 08:48:33 PDT
<rdar://problem/45762874>
Comment 6 David Kilzer (:ddkilzer) 2018-11-02 09:30:19 PDT
<rdar://problem/45682358>
Comment 7 Saam Barati 2018-11-03 15:37:48 PDT
Comment on attachment 353702 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353702&action=review

> Source/JavaScriptCore/ChangeLog:8
> +        We should only ever hold references to the entry in the metadata table.

Why? What about a test for this?
Comment 8 Tadeu Zagallo 2018-11-03 23:07:06 PDT
Comment on attachment 353702 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353702&action=review

>> Source/JavaScriptCore/ChangeLog:8
>> +        We should only ever hold references to the entry in the metadata table.
> 
> Why? What about a test for this?

Because the metadata is mutable, so it's nice to avoid cases like in CodeBlock below, where I was accidentally copying and then mutating a local copy. You're right, I should have added a test. I'll add it now.
Comment 9 Mark Lam 2018-11-04 00:48:33 PDT
Comment on attachment 353702 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353702&action=review

>>> Source/JavaScriptCore/ChangeLog:8
>>> +        We should only ever hold references to the entry in the metadata table.
>> 
>> Why? What about a test for this?
> 
> Because the metadata is mutable, so it's nice to avoid cases like in CodeBlock below, where I was accidentally copying and then mutating a local copy. You're right, I should have added a test. I'll add it now.

I think this is Saam’s way of asking you to add the “why” to the ChangeLog to document this reasoning for posterity.  Can you add your explanation in the ChangeLog here, particularly the part about the sort of bugs this prevents?  Thanks.
Comment 10 Tadeu Zagallo 2018-11-04 00:50:51 PDT
Comment on attachment 353702 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353702&action=review

>>>> Source/JavaScriptCore/ChangeLog:8
>>>> +        We should only ever hold references to the entry in the metadata table.
>>> 
>>> Why? What about a test for this?
>> 
>> Because the metadata is mutable, so it's nice to avoid cases like in CodeBlock below, where I was accidentally copying and then mutating a local copy. You're right, I should have added a test. I'll add it now.
> 
> I think this is Saam’s way of asking you to add the “why” to the ChangeLog to document this reasoning for posterity.  Can you add your explanation in the ChangeLog here, particularly the part about the sort of bugs this prevents?  Thanks.

Yeah, I thought that might be the case. Is it ok to edit a previous ChangeLog entry? Should I add a new ChangeLog entry to say that I'm editing a previous ChangeLog entry?
Comment 11 Saam Barati 2018-11-04 20:51:50 PST
(In reply to Tadeu Zagallo from comment #10)
> Comment on attachment 353702 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=353702&action=review
> 
> >>>> Source/JavaScriptCore/ChangeLog:8
> >>>> +        We should only ever hold references to the entry in the metadata table.
> >>> 
> >>> Why? What about a test for this?
> >> 
> >> Because the metadata is mutable, so it's nice to avoid cases like in CodeBlock below, where I was accidentally copying and then mutating a local copy. You're right, I should have added a test. I'll add it now.
> > 
> > I think this is Saam’s way of asking you to add the “why” to the ChangeLog to document this reasoning for posterity.  Can you add your explanation in the ChangeLog here, particularly the part about the sort of bugs this prevents?  Thanks.
> 
> Yeah, I thought that might be the case. Is it ok to edit a previous
> ChangeLog entry? Should I add a new ChangeLog entry to say that I'm editing
> a previous ChangeLog entry?

Sorry for the ambiguity. I did mean the “why” as a way of asking for this to be documented in the change log. Personally, I’ve never gone back and edited previous change log entries. I’m not sure what the official WebKit stance on that is. I think this bugzilla will act as a point of reference if anyone needs to dig into this more in the future. You could also document it in the changelog for the added test, but that won’t be found as easily as the original commit.