mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-12 02:40:41 -04:00
Fix Addressing_OptionalOk selector expression rules for struct field variables
This commit is contained in:
1 parent
94ba182691
commit
cb52f6986a
1 file changed
+9
-6
+9
-6
@@ -3665,16 +3665,19 @@ Entity *check_selector(CheckerContext *c, Operand *operand, Ast *node, Type *typ
|
||||
}
|
||||
break;
|
||||
case Entity_Variable:
|
||||
// TODO(bill): Is this the rule I need?
|
||||
if (operand->mode == Addressing_Context) {
|
||||
if (sel.indirect) {
|
||||
operand->mode = Addressing_Variable;
|
||||
}
|
||||
if (sel.indirect) {
|
||||
operand->mode = Addressing_Variable;
|
||||
} else if (operand->mode == Addressing_Context) {
|
||||
// Do nothing
|
||||
} else if (operand->mode == Addressing_MapIndex) {
|
||||
operand->mode = Addressing_Value;
|
||||
} else if (entity->flags & EntityFlag_SoaPtrField) {
|
||||
operand->mode = Addressing_SoaVariable;
|
||||
} else if (sel.indirect || operand->mode != Addressing_Value || operand->mode == Addressing_SoaVariable) {
|
||||
} else if (operand->mode == Addressing_OptionalOk) {
|
||||
operand->mode = Addressing_Value;
|
||||
} else if (operand->mode == Addressing_SoaVariable) {
|
||||
operand->mode = Addressing_Variable;
|
||||
} else if (operand->mode != Addressing_Value) {
|
||||
operand->mode = Addressing_Variable;
|
||||
} else {
|
||||
operand->mode = Addressing_Value;
|
||||
|
||||
Reference in new issue
Block a user