Commit e3dcb351 authored by Kevin Modzelewski's avatar Kevin Modzelewski

slice fix

parent 45c13b49
......@@ -978,11 +978,15 @@ public:
class BoxedSlice : public Box {
public:
Box* start, *stop, *step;
BoxedSlice(Box* lower, Box* upper, Box* step) : start(lower), stop(upper), step(step) {}
BoxedSlice(Box* lower, Box* upper, Box* step) : start(lower), stop(upper), step(step) {
ASSERT(lower->cls == none_cls || lower->cls == int_cls, "slice objects are not gc-aware (like in CPython)");
ASSERT(upper->cls == none_cls || upper->cls == int_cls, "slice objects are not gc-aware (like in CPython)");
ASSERT(step->cls == none_cls || step->cls == int_cls, "slice objects are not gc-aware (like in CPython)");
}
static void dealloc(Box* b) noexcept;
DEFAULT_CLASS_SIMPLE(slice_cls, true);
DEFAULT_CLASS_SIMPLE(slice_cls, false);
};
static_assert(sizeof(BoxedSlice) == sizeof(PySliceObject), "");
static_assert(offsetof(BoxedSlice, start) == offsetof(PySliceObject, start), "");
......
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