Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop ignoring GCC's use-after-free warnings in CSSValue::deref()
https://bugs.webkit.org/show_bug.cgi?id=247120 Reviewed by Michael Catanzaro. The use-after-free warnings originating in CSSValue::deref() when compiling with GCC were locally ignored. The few offending places are adjusted to fix the warnings, and the IGNORE_GCC_WARNINGS macros are removed. The warnings are usually thrown when specific optimization passes are enabled and end up creating a use-after-free situation. In both current cases these warnings can be ignored by simplifying the code. In StyleProperties.cpp, the isValueID() and isValueIDIncludingList() functions accepting a Ref<CSSValue> reference are simplified by accepting a trivial CSSValue reference. If a Ref<CSSValue> is passed to these functions now, there's a conversion operator on the Ref template that will handily retrieve the reference. This also reduces reference-counting churn. In CSSPropertyParser.cpp, getBaselineKeyword() is similarly simplified, now accepting a CSSValue reference that's then downcasted into the primitive value, and the sole call site is adjusted accordingly. * Source/WebCore/css/CSSValue.h: (WebCore::CSSValue::deref const): * Source/WebCore/css/StyleProperties.cpp: (WebCore::isValueID): (WebCore::isValueIDIncludingList): * Source/WebCore/css/parser/CSSPropertyParser.cpp: (WebCore::getBaselineKeyword): (WebCore::consumeContentDistributionOverflowPosition): Canonical link: https://commits.webkit.org/256063@main
- Loading branch information