lang: codegen: lambda s_outer_block is now only initialised once
This commit is contained in:
@@ -29,7 +29,11 @@ struct lambda_codegen_state {
|
|||||||
static enum ivy_status switch_to_lambda_func(
|
static enum ivy_status switch_to_lambda_func(
|
||||||
struct ivy_codegen *gen, struct lambda_codegen_state *lambda)
|
struct ivy_codegen *gen, struct lambda_codegen_state *lambda)
|
||||||
{
|
{
|
||||||
lambda->s_outer_block = mie_builder_get_current_block(gen->c_builder);
|
if (!lambda->s_outer_block) {
|
||||||
|
lambda->s_outer_block
|
||||||
|
= mie_builder_get_current_block(gen->c_builder);
|
||||||
|
}
|
||||||
|
|
||||||
struct mie_block *block = mie_func_get_last_block(lambda->s_func);
|
struct mie_block *block = mie_func_get_last_block(lambda->s_func);
|
||||||
if (!block) {
|
if (!block) {
|
||||||
block = mie_func_create_block(lambda->s_func, "entry");
|
block = mie_func_create_block(lambda->s_func, "entry");
|
||||||
|
|||||||
Reference in New Issue
Block a user