mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix Addressing_OptionalOk selector expression rules for struct field variables
This commit is contained in:
+9
-6
@@ -3665,16 +3665,19 @@ Entity *check_selector(CheckerContext *c, Operand *operand, Ast *node, Type *typ
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Entity_Variable:
|
case Entity_Variable:
|
||||||
// TODO(bill): Is this the rule I need?
|
if (sel.indirect) {
|
||||||
if (operand->mode == Addressing_Context) {
|
operand->mode = Addressing_Variable;
|
||||||
if (sel.indirect) {
|
} else if (operand->mode == Addressing_Context) {
|
||||||
operand->mode = Addressing_Variable;
|
// Do nothing
|
||||||
}
|
|
||||||
} else if (operand->mode == Addressing_MapIndex) {
|
} else if (operand->mode == Addressing_MapIndex) {
|
||||||
operand->mode = Addressing_Value;
|
operand->mode = Addressing_Value;
|
||||||
} else if (entity->flags & EntityFlag_SoaPtrField) {
|
} else if (entity->flags & EntityFlag_SoaPtrField) {
|
||||||
operand->mode = Addressing_SoaVariable;
|
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;
|
operand->mode = Addressing_Variable;
|
||||||
} else {
|
} else {
|
||||||
operand->mode = Addressing_Value;
|
operand->mode = Addressing_Value;
|
||||||
|
|||||||
Reference in New Issue
Block a user