From 662b8d2ff3f9da4576646de621b161e1e63cefe2 Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Wed, 8 Feb 2023 16:01:36 +0000 Subject: [PATCH] [hir] Add lvalue effect for PropertyLoad and ComputedLoad --- compiler/forget/src/Inference/InferReferenceEffects.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/forget/src/Inference/InferReferenceEffects.ts b/compiler/forget/src/Inference/InferReferenceEffects.ts index a8c80043f1..6595e9f128 100644 --- a/compiler/forget/src/Inference/InferReferenceEffects.ts +++ b/compiler/forget/src/Inference/InferReferenceEffects.ts @@ -690,6 +690,7 @@ function inferBlock(env: Environment, block: BasicBlock) { env.reference(instrValue.object, Effect.Read); const lvalue = instr.lvalue; + lvalue.place.effect = Effect.Mutate; env.initialize(instrValue, env.kind(instrValue.object)); env.define(lvalue.place, instrValue); continue; @@ -722,6 +723,7 @@ function inferBlock(env: Environment, block: BasicBlock) { env.reference(instrValue.object, Effect.Read); env.reference(instrValue.property, Effect.Read); const lvalue = instr.lvalue; + lvalue.place.effect = Effect.Mutate; env.initialize(instrValue, env.kind(instrValue.object)); env.define(lvalue.place, instrValue); continue;