Page MenuHomePhabricator

[YAMLIO] Correctly diagnose empty alias/anchor
ClosedPublic

Authored by scott.linder on Nov 13 2020, 2:09 PM.

Details

Summary

The Range of an alias/anchor token includes the leading & or *,
but it is skipped while parsing the name. The check for an empty name
fails to account for the skipped leading character and so the error is
never hit.

Fix the off-by-one and add a couple regression tests.

Diff Detail

Unit TestsFailed

TimeTest
380 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp

Event Timeline

scott.linder created this revision.Nov 13 2020, 2:09 PM
scott.linder requested review of this revision.Nov 13 2020, 2:09 PM
dexonsmith accepted this revision.Nov 13 2020, 2:19 PM

LGTM, thanks!

This revision is now accepted and ready to land.Nov 13 2020, 2:19 PM
This revision was landed with ongoing or failed builds.Nov 16 2020, 10:45 AM
This revision was automatically updated to reflect the committed changes.