Commit 26965a58 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix a llvm-tier getiter() bug

If we find a type that
- we think we can reason about statically
- does not have an __iter__ but can be iterated via __getitem__

we previously just bailed saying that we know it doesn't have an __iter__ method
(instead of calling getiterHelper like we should).  This bug exists on master as well,
but we just don't run into it that often (especially since it's llvm-tier-only).
parent 833d9c25
......@@ -1973,8 +1973,16 @@ public:
const std::vector<BoxedString*>* keyword_names) override {
ExceptionStyle exception_style = info.preferredExceptionStyle();
bool no_attribute = false;
bool* no_attribute_ptr = NULL;
if (flags.null_on_nonexistent)
no_attribute_ptr = &no_attribute;
CompilerVariable* called_constant = tryCallattrConstant(emitter, info, var, attr, flags.cls_only, flags.argspec,
args, keyword_names, NULL, exception_style);
args, keyword_names, no_attribute_ptr, exception_style);
if (no_attribute)
return new ConcreteCompilerVariable(UNKNOWN, getNullPtr(g.llvm_value_type_ptr));
if (called_constant)
return called_constant;
......
......@@ -41,7 +41,7 @@ public:
static void dealloc(BoxedSeqIter* o) noexcept {
PyObject_GC_UnTrack(o);
Py_DECREF(o->b);
Py_XDECREF(o->b);
Py_XDECREF(o->next);
o->cls->tp_free(o);
}
......
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