WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
141402
Check for self-assignment in Length::operator=(const Length&)
https://bugs.webkit.org/show_bug.cgi?id=141402
Summary
Check for self-assignment in Length::operator=(const Length&)
Chris Dumez
Reported
2015-02-09 14:31:55 PST
Check for self-assignment in Length::operator=(const Length&) as calling memset() with the same source and destination addresses has undefined behavior.
Attachments
Patch
(1.33 KB, patch)
2015-02-09 14:34 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(1.33 KB, patch)
2015-02-09 14:40 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2015-02-09 14:34:17 PST
Created
attachment 246292
[details]
Patch
Chris Dumez
Comment 2
2015-02-09 14:40:37 PST
Created
attachment 246293
[details]
Patch
WebKit Commit Bot
Comment 3
2015-02-09 17:17:48 PST
Comment on
attachment 246293
[details]
Patch Clearing flags on attachment: 246293 Committed
r179860
: <
http://trac.webkit.org/changeset/179860
>
WebKit Commit Bot
Comment 4
2015-02-09 17:17:52 PST
All reviewed patches have been landed. Closing bug.
David Kilzer (:ddkilzer)
Comment 5
2015-02-10 09:18:06 PST
(In reply to
comment #0
)
> Check for self-assignment in Length::operator=(const Length&) as calling > memset() with the same source and destination addresses has undefined > behavior.
On Darwin platforms (iOS, OS X), the undefined behavior has been well-defined as being identical to memmove(). (However, that's not true on other platforms, so it's still a good idea to fix this.)
Chris Dumez
Comment 6
2015-02-10 09:49:00 PST
(In reply to
comment #5
)
> (In reply to
comment #0
) > > Check for self-assignment in Length::operator=(const Length&) as calling > > memset() with the same source and destination addresses has undefined > > behavior. > > On Darwin platforms (iOS, OS X), the undefined behavior has been > well-defined as being identical to memmove(). (However, that's not true on > other platforms, so it's still a good idea to fix this.)
Oh, I did not know that. If I do a "man memcpy" on my Mac, it says "If dst and src overlap, behavior is undefined".
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