Commit 7e42a198 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix a couple bool issues

parent 8ab8475a
......@@ -27,7 +27,7 @@ extern "C" PyObject* PyBool_FromLong(long n) noexcept {
}
extern "C" Box* boolNonzero(BoxedBool* v) {
return v;
return incref(v);
}
extern "C" Box* boolRepr(BoxedBool* v) {
......
......@@ -4255,7 +4255,7 @@ void setupRuntime() {
attrwrapper_cls->tp_mro = BoxedTuple::create({ attrwrapper_cls, object_cls });
dict_cls->tp_mro = BoxedTuple::create({ dict_cls, object_cls });
int_cls->tp_mro = BoxedTuple::create({ int_cls, object_cls });
bool_cls->tp_mro = BoxedTuple::create({ bool_cls, object_cls });
bool_cls->tp_mro = BoxedTuple::create({ bool_cls, int_cls, object_cls });
complex_cls->tp_mro = BoxedTuple::create({ complex_cls, object_cls });
long_cls->tp_mro = BoxedTuple::create({ long_cls, object_cls });
float_cls->tp_mro = BoxedTuple::create({ float_cls, object_cls });
......
# expected: reffail
# Regression test: we rely internally on CompilerType.nonzero() always returning a BOOL,
# in at least these two cases.
......
# expected: reffail
# Test that we can pass known-bool values through OSRs and what not:
def f(b):
......
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