Skip to content

Commit

Permalink
context: Deal correctly with closure of nil
Browse files Browse the repository at this point in the history
Nil is now represented by a nullptr. So Context::Enclose must deal with that.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
  • Loading branch information
c3d committed Apr 5, 2021
1 parent 29b1005 commit 68b258d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/context.h
Expand Up @@ -1345,7 +1345,7 @@ inline Tree *Context::Enclose(Tree *value)
// Prefix the value wiht the current symbols - Unwrapped by evaluate()
// ----------------------------------------------------------------------------
{
if (!value->As<Closure>())
if (value && !value->As<Closure>())
{
// Strip blocks (if-then-else common optimization)
Tree *expr = value;
Expand Down

0 comments on commit 68b258d

Please sign in to comment.