Skip to content

fix(checker): detect $env() calls at compile time#923

Open
thevilledev wants to merge 1 commit intoexpr-lang:masterfrom
thevilledev:fix/clusterfuzz-481635418
Open

fix(checker): detect $env() calls at compile time#923
thevilledev wants to merge 1 commit intoexpr-lang:masterfrom
thevilledev:fix/clusterfuzz-481635418

Conversation

@thevilledev
Copy link
Contributor

Previously, expressions like $env(abs()) would compile without error and cause a runtime "stack underflow" panic. The checker now validates that $env cannot be used as a function callee, producing a clear error message like "map[string]interface {} is not callable".

Maybe a more long-term fix would be to add an EnvNode AST type. Now $env is used here and there as-is.

Relates to #922.

Previously, expressions like `$env(abs())` would compile without error
and cause a runtime "stack underflow" panic. The checker now validates
that $env cannot be used as a function callee, producing a clear error
message like "map[string]interface {} is not callable".

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant