diff options
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r-- | src/mir/from_hir.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index 7ded3cb4..a763b42c 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -1376,10 +1376,9 @@ namespace { const auto& trait = *te.m_trait.m_trait_ptr; // 1. Get the vtable index for this function - unsigned int vtable_idx = trait.m_values.at( pe.item ).vtable_ofs; - if( vtable_idx == ~0u ) { + if( trait.m_value_indexes.count(pe.item) == 0 ) BUG(sp, "Calling method '" << pe.item << "' of " << pe.trait << " which isn't in the vtable"); - } + unsigned int vtable_idx = trait.m_value_indexes.at( pe.item ); // 2. Load from the vtable auto vtable_rval = ::MIR::RValue::make_DstMeta({ |