mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 17:34:34 +00:00
Fix Addressing_OptionalOk selector expression rules for struct field variables
This commit is contained in:
@@ -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