fix GC safety bug in builtin.cpp

This commit is contained in:
Joel Dice 2009-06-11 17:13:25 -06:00
parent 1d58541c87
commit 525318dabb

View File

@ -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<char*>(&byteArrayBody(t, n, 0));
stringChars(t, name, s);