Commit c7640dc8 authored by Boxiang Sun's avatar Boxiang Sun

loose the dummy code object check

Cython try to store argcount, nlocals, and varnames through PyCode_New.
But Pyston don't do anything with those or support getting them back
out.
parent f0755588
......@@ -137,8 +137,10 @@ extern "C" PyCodeObject* PyCode_New(int argcount, int nlocals, int stacksize, in
is_dummy = is_dummy && code == EmptyString && lnotab == EmptyString;
for (auto&& var : { consts, names, varnames, freevars, cellvars })
is_dummy = is_dummy && var == EmptyTuple;
RELEASE_ASSERT(is_dummy, "not implemented");
// ok this is an empty/dummy code object
// The follwing variables are not implemented but we allow them because there is currently
// no way for code to retrieve them.
auto temp_allowed = argcount || argcount || flags || varnames != EmptyTuple;
RELEASE_ASSERT(is_dummy || temp_allowed, "not implemented");
RELEASE_ASSERT(PyString_Check(filename), "");
RELEASE_ASSERT(PyString_Check(name), "");
......
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