Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Issue 418253003: Don't dereference null pointer in FastTextAutosizer::getTentativeClusterRoots() (Closed)

Created:
6 years, 4 months ago by hans
Modified:
6 years, 4 months ago
Reviewers:
pdr., Nico, skobes
CC:
blink-reviews, blink-reviews-rendering, zoltan1, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, rune+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Don't dereference null pointer in FastTextAutosizer::getTentativeClusterRoots() The result of m_blocksForFingerprint.get() can be a null pointer, so don't dereference it (that invokes undefined behaviour). Instead, just return the pointer. Recent versions of Clang will optimize based on references always pointing to valid objects. In the previous code below: BlockSet* roots = m_fingerprintMapper.getTentativeClusterRoots(fingerprint); if (!roots || roots->size() < 2 || !roots->contains(block)) return 0; the "!roots" null check would be optimized away, since "roots" is the address of a reference, and must therefore point to a valid object. BUG=38149 TEST=fast/text-autosizing tests don't crash with new Clang Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179171

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -4 lines) Patch
M Source/core/rendering/FastTextAutosizer.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/FastTextAutosizer.cpp View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
hans
Please take a look.
6 years, 4 months ago (2014-07-29 17:39:27 UTC) #1
Nico
lgtm
6 years, 4 months ago (2014-07-29 17:43:07 UTC) #2
pdr.
On 2014/07/29 17:43:07, Nico (away) wrote: > lgtm LGTM2
6 years, 4 months ago (2014-07-29 17:56:08 UTC) #3
pdr.
The CQ bit was checked by pdr@chromium.org
6 years, 4 months ago (2014-07-29 17:56:13 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hans@chromium.org/418253003/1
6 years, 4 months ago (2014-07-29 17:56:44 UTC) #5
commit-bot: I haz the power
6 years, 4 months ago (2014-07-29 20:06:48 UTC) #6
Message was sent while issue was closed.
Change committed as 179171

Powered by Google App Engine
This is Rietveld 408576698