[clang][Interp] Check instance pointers before calling functions on them
authorTimm Bäder <tbaeder@redhat.com>
Fri, 7 Oct 2022 13:49:37 +0000 (15:49 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Sat, 22 Oct 2022 08:32:05 +0000 (10:32 +0200)
commitcc79ddb52c310be50d2ed0e0307b695cc7c142ce
tree77b2f312e87a255ca54ba7cb76be33c09df2cd86
parent8013ab4f98c2ed3bb11dcb83179664cb595c31bb
[clang][Interp] Check instance pointers before calling functions on them

Remove the double Call() implementation to reduce code duplication. Then
fix Function::getSource() so we can diagnose instance pointers being
null.

Differential Revision: https://reviews.llvm.org/D135513
clang/lib/AST/Interp/EvalEmitter.cpp
clang/lib/AST/Interp/Function.cpp
clang/lib/AST/Interp/Interp.cpp
clang/lib/AST/Interp/Interp.h
clang/lib/AST/Interp/Opcodes.td
clang/test/AST/Interp/records.cpp