Page MenuHomePhabricator

[clang] Fix a crash case when reporting an uninitialized field.
Needs ReviewPublic

Authored by hliao on Dec 17 2021, 3:06 PM.

Details

Reviewers
rsmith
Summary
  • As the initializer list's getSyntacticForm() may return NULL, need to consider the current semantic initalizer list itself as the synatic form. Wrap that together into a new getSourceRange method.

Diff Detail

Unit TestsFailed

TimeTest
3,140 msx64 debian > AddressSanitizer-x86_64-linux-dynamic.TestCases::strncpy-overflow.cpp
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libasan -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Output/strncpy-overflow.cpp.tmp && not /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Output/strncpy-overflow.cpp.tmp 2>&1 | FileCheck /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
4,420 msx64 debian > AddressSanitizer-x86_64-linux.TestCases::strncpy-overflow.cpp
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/strncpy-overflow.cpp.tmp && not /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/strncpy-overflow.cpp.tmp 2>&1 | FileCheck /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
70 msx64 debian > LLVM.Bindings/Go::go.test
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-go go=/usr/bin/go test llvm.org/llvm/bindings/go/llvm

Event Timeline

hliao requested review of this revision.Dec 17 2021, 3:06 PM
hliao created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2021, 3:06 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
hliao updated this revision to Diff 395248.Dec 17 2021, 6:11 PM

Revise the formatting.