summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib.c b/lib.c
index 94e462ba..b6b94ebb 100644
--- a/lib.c
+++ b/lib.c
@@ -5093,14 +5093,22 @@ val string_get_code(val str)
val stringp(val str)
{
- switch (type(str)) {
- case LIT:
- case STR:
- case LSTR:
+ if (str) switch (tag(str)) {
+ case TAG_LIT:
return t;
+ case TAG_PTR:
+ switch (str->t.type) {
+ case STR:
+ case LSTR:
+ return t;
+ default:
+ break;
+ }
+ /* fallthrough */
default:
- return nil;
+ break;
}
+ return nil;
}
val lazy_stringp(val str)