diff --git a/src/builtin.cpp b/src/builtin.cpp index a1280163d4..f4541036d4 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -27,6 +27,8 @@ search(Thread* t, object name, object (*op)(Thread*, object), bool replaceDots) { if (LIKELY(name)) { + PROTECT(t, name); + object n = makeByteArray(t, stringLength(t, name) + 1); char* s = reinterpret_cast(&byteArrayBody(t, n, 0)); stringChars(t, name, s);