Commit 6b935b9b authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix a capi bug: we were passing the wrong value through as passthrough

Most of the time this just gets ignored (its usually the parent module,
and functions don't usually care about that) but here it doesn't.
parent ef93c2d8
......@@ -1523,12 +1523,13 @@ Box* BoxedCApiFunction::callInternal(BoxedFunctionBase* func, CallRewriteArgs* r
if (rewrite_args) {
rewrite_args->arg1->addGuard((intptr_t)arg1);
RewriterVar* r_passthrough = rewrite_args->arg1->getAttr(offsetof(BoxedCApiFunction, passthrough));
rewrite_args->out_rtn
= rewrite_args->rewriter->call(true, (void*)capifunc->func, rewrite_args->arg1, rewrite_args->arg2);
= rewrite_args->rewriter->call(true, (void*)capifunc->func, r_passthrough, rewrite_args->arg2);
rewrite_args->rewriter->call(true, (void*)checkAndThrowCAPIException);
rewrite_args->out_success = true;
}
Box* r = capifunc->func(arg1, arg2);
Box* r = capifunc->func(capifunc->passthrough, arg2);
checkAndThrowCAPIException();
assert(r);
return r;
......
......@@ -16,8 +16,11 @@ for k in sorted(dir(select)):
p = select.poll()
f = open('/dev/null')
p.register(f)
gc.collect()
p.unregister(f)
p.register(f)
try:
p.register(f)
print p.poll(10)
finally:
f.close()
......
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