diff options
Diffstat (limited to 'lib/CodeGen/Designator.cc')
| -rw-r--r-- | lib/CodeGen/Designator.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc index 640ca0b..9d14d23 100644 --- a/lib/CodeGen/Designator.cc +++ b/lib/CodeGen/Designator.cc @@ -145,6 +145,11 @@ bool CodeGen::emitLValue(ExprAST *E, LValueInfo &Out) { reportError("Record type %s has no field %s", TypeName.c_str(), A.FieldName.c_str()); return false; } + if (!FI->IsPublic) { + reportError("Cannot access private field %s of type %s", + A.FieldName.c_str(), TypeName.c_str()); + return false; + } Addr = Builder->CreateStructGEP(Cur->LLVMType, Addr, FI->Index, TypeName + "." + A.FieldName); TypeName = FI->TypeName; |
