mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix #2167 context.assertion_failure_proc = nil (context field assignments)
This commit is contained in:
@@ -383,16 +383,27 @@ Type *lb_addr_type(lbAddr const &addr) {
|
|||||||
if (addr.addr.value == nullptr) {
|
if (addr.addr.value == nullptr) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (addr.kind == lbAddr_Map) {
|
switch (addr.kind) {
|
||||||
Type *t = base_type(addr.map.type);
|
case lbAddr_Map:
|
||||||
GB_ASSERT(is_type_map(t));
|
{
|
||||||
return t->Map.value;
|
Type *t = base_type(addr.map.type);
|
||||||
}
|
GB_ASSERT(is_type_map(t));
|
||||||
if (addr.kind == lbAddr_Swizzle) {
|
return t->Map.value;
|
||||||
|
}
|
||||||
|
case lbAddr_Swizzle:
|
||||||
return addr.swizzle.type;
|
return addr.swizzle.type;
|
||||||
}
|
case lbAddr_SwizzleLarge:
|
||||||
if (addr.kind == lbAddr_SwizzleLarge) {
|
|
||||||
return addr.swizzle_large.type;
|
return addr.swizzle_large.type;
|
||||||
|
case lbAddr_Context:
|
||||||
|
if (addr.ctx.sel.index.count > 0) {
|
||||||
|
Type *t = t_context;
|
||||||
|
for_array(i, addr.ctx.sel.index) {
|
||||||
|
GB_ASSERT(is_type_struct(t));
|
||||||
|
t = base_type(t)->Struct.fields[addr.ctx.sel.index[i]]->type;
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return type_deref(addr.addr.type);
|
return type_deref(addr.addr.type);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user