Commit 5e418340 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Found the crash: need to register set_iterator_cls as a static root

parent d0590d23
......@@ -17,6 +17,7 @@
#include <sstream>
#include "codegen/compvars.h"
#include "gc/collector.h"
#include "runtime/objmodel.h"
namespace pyston {
......@@ -214,6 +215,7 @@ void setupSet() {
new BoxedFunction(boxRTFunction((void*)setiteratorHasnext, BOXED_BOOL, 1, false)));
set_iterator_cls->giveAttr("next", new BoxedFunction(boxRTFunction((void*)setiteratorNext, UNKNOWN, 1, false)));
set_iterator_cls->freeze();
gc::registerStaticRootObj(set_iterator_cls);
CLFunction* new_ = boxRTFunction((void*)setNew1, SET, 1, false);
addRTFunction(new_, (void*)setNew2, SET, 2, false);
......
# expected: fail
# - crashes somewhere
# - need to support closures
import sys
......
......@@ -28,3 +28,6 @@ s.add(None)
print len(s)
print set([1])
for i in set([1]):
print i
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