From e2a3e6792d7e4460b64d1a68eece3aced78a043a Mon Sep 17 00:00:00 2001 From: Folkert Date: Fri, 25 Jun 2021 22:37:30 +0200 Subject: [PATCH] add assert --- compiler/gen_llvm/src/llvm/bitcode.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/gen_llvm/src/llvm/bitcode.rs b/compiler/gen_llvm/src/llvm/bitcode.rs index a2c9f5f079..f5c890cb50 100644 --- a/compiler/gen_llvm/src/llvm/bitcode.rs +++ b/compiler/gen_llvm/src/llvm/bitcode.rs @@ -73,6 +73,9 @@ pub fn build_has_tag_id<'a, 'ctx, 'env>( ) -> FunctionValue<'ctx> { let fn_name: &str = &format!("{}_has_tag_id", function.get_name().to_string_lossy()); + // currently the code assumes we're dealing with a non-recursive layout + debug_assert!(matches!(union_layout, UnionLayout::NonRecursive(_))); + match env.module.get_function(fn_name) { Some(function_value) => function_value, None => build_has_tag_id_help(env, union_layout, &fn_name),