Skip to content

Instantly share code, notes, and snippets.

@Daetalus
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daetalus/2f9da47f5e0dc247b20e to your computer and use it in GitHub Desktop.
Save Daetalus/2f9da47f5e0dc247b20e to your computer and use it in GitHub Desktop.
Instance __setslice__ implementation
Box* instanceSetslice(Box* _inst, Box* i, Box* j, Box** sequence) {
RELEASE_ASSERT(_inst->cls == instance_cls, "");
BoxedInstance* inst = static_cast<BoxedInstance*>(_inst);
static BoxedString* setslice_str = internStringImmortal("__setslice__");
Box* setslice_func = NULL;
try {
setslice_func = _instanceGetattribute(inst, setslice_str, false);
} catch (ExcInfo e) {
if (!e.matches(AttributeError))
throw e;
}
if (setslice_func == NULL) {
Box* slice = static_cast<Box*>(createSlice(i, j, None));
return instanceSetitem(inst, slice, sequence);
}
return runtimeCall(setslice_func, ArgPassSpec(3), i, j, *sequence, NULL, NULL);
}
Here is the backtrace:
#4 0x00000000015849a4 in pyston::rearrangeArguments (paramspec=..., param_names=0x7ffff387b2d0,
func_name=0x1270040af9 "__setslice__", defaults=0x0, rewrite_args=0x0, rewrite_success=@0x7fffffffba87: false,
argspec=..., arg1=0x12701bed98, arg2=0x1270014148, arg3=0x12700141a8, args=0x7fffffffbcf0, keyword_names=0x0,
oarg1=@0x7fffffffbaa0: 0x1270183808, oarg2=@0x7fffffffba98: 0x0, oarg3=@0x7fffffffba90: 0x15ecc00,
oargs=0x7fffffffb7f0) at ../../src/runtime/objmodel.cpp:3259
#5 0x00000000008c4b81 in pyston::callFunc (func=0x12701b4be8, rewrite_args=0x0, argspec=..., arg1=0x12701bed98,
arg2=0x1270014148, arg3=0x12700141a8, args=0x7fffffffbcf0, keyword_names=0x0)
at ../../src/runtime/objmodel.cpp:3595
#6 0x00000000008c2ff8 in pyston::runtimeCallInternal (obj=0x12701b4be8, rewrite_args=0x0, argspec=...,
arg1=0x12701bed98, arg2=0x1270014148, arg3=0x12700141a8, args=0x7fffffffbcf0, keyword_names=0x0)
at ../../src/runtime/objmodel.cpp:3878
#7 0x00000000008c3339 in pyston::runtimeCallInternal (obj=0x12701bf188, rewrite_args=0x0, argspec=...,
arg1=0x12701bed98, arg2=0x1270014148, arg3=0x12700141a8, args=0x0, keyword_names=0x0)
at ../../src/runtime/objmodel.cpp:3922
#8 0x00000000008c8b64 in runtimeCall (obj=0x12701bf188, argspec=..., arg1=0x1270014148, arg2=0x12700141a8,
arg3=0x7fffffffc500, args=0x0, keyword_names=0x0) at ../../src/runtime/objmodel.cpp:3990
#9 0x000000000085c8fd in pyston::instanceSetslice (_inst=0x12701bed98, i=0x1270014148, j=0x12700141a8,
sequence=0x7fffffffc500) at ../../src/runtime/classobj.cpp:577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment