Commit 1a8566b3 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #79 from undingen/fix_crash

Fix crash: register string iterator class
parents 115c787c 03053342
......@@ -23,6 +23,7 @@
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/types.h"
#include "gc/collector.h"
#include "runtime/gc_runtime.h"
#include "runtime/objmodel.h"
#include "runtime/types.h"
......@@ -565,6 +566,7 @@ Box* strCount2(BoxedString* self, Box* elt) {
void setupStr() {
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("__hasnext__",
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