summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regex.c b/regex.c
index 767958e8..19bbd785 100644
--- a/regex.c
+++ b/regex.c
@@ -1061,7 +1061,8 @@ val regex_compile(val regex_sexp)
val regexp(val obj)
{
- return (obj->co.type == COBJ && obj->co.cls == regex) ? t : nil;
+ return (is_ptr(obj) && obj->co.type == COBJ && obj->co.cls == regex)
+ ? t : nil;
}
nfa_t *regex_nfa(val reg)