Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xrtm000 committed Nov 27, 2023
1 parent cffc58b commit 230102d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import cats.{Id, Show}
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.lang.{CommonError, StringOps}
import com.wavesplatform.lang.directives.values.{StdLibVersion, V8}
import com.wavesplatform.lang.hacks.Global
import com.wavesplatform.lang.v1.compiler.CompilationError.*
import com.wavesplatform.lang.v1.compiler.CompilerContext.*
import com.wavesplatform.lang.v1.compiler.ExpressionCompiler.*
Expand Down Expand Up @@ -39,7 +38,7 @@ class ExpressionCompiler(val version: StdLibVersion) {

def adjustStr(expr: Expressions.CONST_STRING, str: String): Either[CompilationError, CompilationStepResultExpr] =
CONST_STRING(str)
.filterOrElse(_ => allowIllFormedStrings || !Global.isIllFormed(str), CommonError(s"String '$str' contains ill-formed characters"))
.filterOrElse(_ => allowIllFormedStrings || str.isWellFormed, CommonError(s"String '$str' contains ill-formed characters"))
.leftMap(e => CompilationError.Generic(expr.position.start, expr.position.end, e.message))
.map(CompilationStepResultExpr(ctx, _, STRING, expr))
.recover { case err => CompilationStepResultExpr(ctx, FAILED_EXPR(), NOTHING, expr, List(err)) }
Expand Down

0 comments on commit 230102d

Please sign in to comment.