mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
Fix #20859 - ICE: class with __vtbl field name causes segfault in Scope::inCfile
This commit is contained in:
parent
72a9347165
commit
eb083c06d9
2 changed files with 13 additions and 1 deletions
|
@ -4137,7 +4137,8 @@ private extern(C++) class AddMemberVisitor : Visitor
|
||||||
}
|
}
|
||||||
|
|
||||||
// If using C tag/prototype/forward declaration rules
|
// If using C tag/prototype/forward declaration rules
|
||||||
if (sc.flags & SCOPE.Cfile && !dsym.isImport())
|
if (sc && sc.flags & SCOPE.Cfile && !dsym.isImport())
|
||||||
|
// When merging master, replace with: if (sc && sc.inCfile && !dsym.isImport())
|
||||||
{
|
{
|
||||||
if (handleTagSymbols(*sc, dsym, s2, sds))
|
if (handleTagSymbols(*sc, dsym, s2, sds))
|
||||||
return;
|
return;
|
||||||
|
|
11
compiler/test/fail_compilation/test20859.d
Normal file
11
compiler/test/fail_compilation/test20859.d
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
TEST_OUTPUT:
|
||||||
|
---
|
||||||
|
fail_compilation/test20859.d(8): Error: variable `test20859.ICE.__vtbl` conflicts with variable `test20859.ICE.__vtbl` at fail_compilation/test20859.d(10)
|
||||||
|
---
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ICE
|
||||||
|
{
|
||||||
|
void **__vtbl;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue