mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 14:18:47 +00:00
Merge pull request #3370 from laytan/fix-objc-proc-group-edge-case
fix objc proc group edge case
This commit is contained in:
@@ -4677,8 +4677,10 @@ gb_internal lbAddr lb_build_addr_internal(lbProcedure *p, Ast *expr) {
|
|||||||
if (tav.mode == Addressing_Type) { // Addressing_Type
|
if (tav.mode == Addressing_Type) { // Addressing_Type
|
||||||
Selection sel = lookup_field(tav.type, selector, true);
|
Selection sel = lookup_field(tav.type, selector, true);
|
||||||
if (sel.pseudo_field) {
|
if (sel.pseudo_field) {
|
||||||
GB_ASSERT(sel.entity->kind == Entity_Procedure);
|
GB_ASSERT(sel.entity->kind == Entity_Procedure || sel.entity->kind == Entity_ProcGroup);
|
||||||
return lb_addr(lb_find_value_from_entity(p->module, sel.entity));
|
Entity *e = entity_of_node(sel_node);
|
||||||
|
GB_ASSERT(e->kind == Entity_Procedure);
|
||||||
|
return lb_addr(lb_find_value_from_entity(p->module, e));
|
||||||
}
|
}
|
||||||
GB_PANIC("Unreachable %.*s", LIT(selector));
|
GB_PANIC("Unreachable %.*s", LIT(selector));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3158,7 +3158,7 @@ gb_internal Selection lookup_field_with_selection(Type *type_, String field_name
|
|||||||
mutex_lock(md->mutex);
|
mutex_lock(md->mutex);
|
||||||
defer (mutex_unlock(md->mutex));
|
defer (mutex_unlock(md->mutex));
|
||||||
for (TypeNameObjCMetadataEntry const &entry : md->type_entries) {
|
for (TypeNameObjCMetadataEntry const &entry : md->type_entries) {
|
||||||
GB_ASSERT(entry.entity->kind == Entity_Procedure);
|
GB_ASSERT(entry.entity->kind == Entity_Procedure || entry.entity->kind == Entity_ProcGroup);
|
||||||
if (entry.name == field_name) {
|
if (entry.name == field_name) {
|
||||||
sel.entity = entry.entity;
|
sel.entity = entry.entity;
|
||||||
sel.pseudo_field = true;
|
sel.pseudo_field = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user