Commit 03053342 authored by Marius Wachtler's avatar Marius Wachtler

Fix crash: register string iterator class

parent 9a33763c
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "codegen/compvars.h" #include "codegen/compvars.h"
#include "core/common.h" #include "core/common.h"
#include "core/types.h" #include "core/types.h"
#include "gc/collector.h"
#include "runtime/gc_runtime.h" #include "runtime/gc_runtime.h"
#include "runtime/objmodel.h" #include "runtime/objmodel.h"
#include "runtime/types.h" #include "runtime/types.h"
...@@ -565,6 +566,7 @@ Box* strCount2(BoxedString* self, Box* elt) { ...@@ -565,6 +566,7 @@ Box* strCount2(BoxedString* self, Box* elt) {
void setupStr() { void setupStr() {
str_iterator_cls = new BoxedClass(object_cls, 0, sizeof(BoxedString), false); str_iterator_cls = new BoxedClass(object_cls, 0, sizeof(BoxedString), false);
gc::registerStaticRootObj(str_iterator_cls);
str_iterator_cls->giveAttr("__name__", boxStrConstant("striterator")); str_iterator_cls->giveAttr("__name__", boxStrConstant("striterator"));
str_iterator_cls->giveAttr("__hasnext__", str_iterator_cls->giveAttr("__hasnext__",
new BoxedFunction(boxRTFunction((void*)BoxedStringIterator::hasnext, NULL, 1, false))); new BoxedFunction(boxRTFunction((void*)BoxedStringIterator::hasnext, NULL, 1, false)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment