DescriptionDon'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 #
Messages
Total messages: 6 (0 generated)
|