From ee51a7eaba127761edd60abcbc9c718e47a986bb Mon Sep 17 00:00:00 2001 From: Yongwook Choi Date: Thu, 6 Jul 2023 16:51:16 +0900 Subject: [PATCH] Fix `lookupStr` not to lookup when `str` is Bottom --- src/main/scala/esmeta/analyzer/domain/state/TypeDomain.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/esmeta/analyzer/domain/state/TypeDomain.scala b/src/main/scala/esmeta/analyzer/domain/state/TypeDomain.scala index 905e29cdc1..6cc8c359b7 100644 --- a/src/main/scala/esmeta/analyzer/domain/state/TypeDomain.scala +++ b/src/main/scala/esmeta/analyzer/domain/state/TypeDomain.scala @@ -340,8 +340,9 @@ object TypeDomain extends state.Domain { // string lookup private def lookupStr(str: BSet[String], prop: ValueTy): ValueTy = var res = ValueTy() + if (str.isBottom) return res if (prop.str contains "length") res ||= MathT - if (!str.isBottom && !prop.math.isBottom) res ||= CodeUnitT + if (!prop.math.isBottom) res ||= CodeUnitT // TODO if (!str.isBottom) // boundCheck( // prop,