Skip to content

Instantly share code, notes, and snippets.

@zsx
Created August 26, 2014 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zsx/9c8628db9bcded698b5a to your computer and use it in GitHub Desktop.
Save zsx/9c8628db9bcded698b5a to your computer and use it in GitHub Desktop.
diff --git a/src/core/n-control.c b/src/core/n-control.c
index e927576..29acd80 100644
--- a/src/core/n-control.c
+++ b/src/core/n-control.c
@@ -764,6 +764,13 @@ got_err:
}
else { // do func[error] arg
REBVAL arg = *DS_NEXT; // will get overwritten
+ REBSER *words = VAL_FUNC_WORDS(&value);
+ REBVAL *args = BLK_SKIP(words, 1);
+ if (SERIES_TAIL(words) != 2
+ || !TYPE_CHECK(args, VAL_TYPE(&value))) {
+ Trap_Arg(&value);
+ }
+
Apply_Func(0, &value, &arg, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment