We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent acff0b0 commit 11ba795Copy full SHA for 11ba795
clang/lib/AST/Interp/Interp.h
@@ -1846,6 +1846,15 @@ inline bool This(InterpState &S, CodePtr OpPC) {
1846
if (!CheckThis(S, OpPC, This))
1847
return false;
1848
1849
+ // Ensure the This pointer has been cast to the correct base.
1850
+ if (!This.isDummy()) {
1851
+ assert(isa<CXXMethodDecl>(S.Current->getFunction()->getDecl()));
1852
+ assert(This.getRecord());
1853
+ assert(
1854
+ This.getRecord()->getDecl() ==
1855
+ cast<CXXMethodDecl>(S.Current->getFunction()->getDecl())->getParent());
1856
+ }
1857
+
1858
S.Stk.push<Pointer>(This);
1859
return true;
1860
}
0 commit comments