Commit eef06d78 authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by 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).  I think we've always had this,
we've just never run into it until testing the refcounting in llvm-only mode.
parent 83f56df0
......@@ -1993,8 +1993,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), 1);
if (called_constant)
return called_constant;
......
def f():
u = u'aoeu'
for c in u:
print repr(c)
f()
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