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
254757
SVGPathSegValue::clone<>() rename to SVGPathSegValue::cloneInternal<>()
https://bugs.webkit.org/show_bug.cgi?id=254757
Summary
SVGPathSegValue::clone<>() rename to SVGPathSegValue::cloneInternal<>()
Michael Catanzaro
Reported
2023-03-30 11:43:11 PDT
SVGPathSeg has a virtual function SVGPathSeg::clone which you would expect to clone any SVGPathSeg, retaining its derived type. However, the virtual clone gets hidden by SVGPathSegValue<PathSegType>::clone because templated functions are never virtual. I think this means a clone operation on a SVGPathSeg pointer will work correctly if the SVGPathSeg is a SVGPathSegValue. This problem was found by GCC 13's -Woverloaded-virtual warning. I don't know what to do about this. For now I'll just suppress the warning.
Attachments
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2023-03-30 11:46:34 PDT
(In reply to Michael Catanzaro from
comment #0
)
> I think this means a clone operation on a > SVGPathSeg pointer will work correctly if the SVGPathSeg is a > SVGPathSegValue.
I meant: will not work correctly. The SVGPathSegValue<PathSegType>::clone would only get called via a pointer to an SVGPathSegValue<PathSegType>. With a pointer to an SVGPathSeg, I think the program should abort with a runtime error due to unimplemented virtual function?
Radar WebKit Bug Importer
Comment 2
2023-04-06 11:44:16 PDT
<
rdar://problem/107719787
>
Said Abou-Hallawa
Comment 3
2023-04-06 13:41:17 PDT
I think this might be a bug or limitation in GCC 13 complier. The clang complier considers the template function SVGPathSegValue::clone<>() different from the virtual function SVGPathSeg::clone() so it does not generate an error saying the template function hides the virtual implementations. Open LayoutTests/svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg in the debugger and set a breakpoint in SVGPathSegMovetoAbs::clone(). In Xcode the debugger breaks at the function. SVGPathSegValue::clone<>() should be renamed to SVGPathSegValue::cloneInternal<>(). So the code can be complied on GCC 13 without the need for -Woverloaded-virtual.
Said Abou-Hallawa
Comment 4
2023-04-06 13:51:42 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/12476
EWS
Comment 5
2023-04-06 16:23:13 PDT
Committed
262690@main
(9fc3aff2f387): <
https://commits.webkit.org/262690@main
> Reviewed commits have been landed. Closing PR #12476 and removing active labels.
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