Commit c30e503e authored by Kevin Modzelewski's avatar Kevin Modzelewski

Misc fixes / helpers

parent 14a7c587
......@@ -1508,7 +1508,7 @@ Value ASTInterpreter::visit_name(AST_Name* node) {
assert(getSymVRegMap()[node->id] == node->vreg);
Box* val = vregs[node->vreg];
if (val) {
assert(gc::isValidGCObject(val));
ASSERT(gc::isValidGCObject(val), "%s is %p", node->id.c_str(), val);
v.o = val;
return v;
}
......
......@@ -682,11 +682,6 @@ static void markPhase() {
// pending finalization list.
orderFinalizers();
#if TRACE_GC_MARKING
fclose(trace_fp);
trace_fp = NULL;
#endif
#ifndef NVALGRIND
VALGRIND_ENABLE_ERROR_REPORTING;
#endif
......
......@@ -497,7 +497,7 @@ SmallArena::Block** SmallArena::_freeChain(Block** head, std::vector<Box*>& weak
clearMark(al);
} else {
if (_doFree(al, &weakly_referenced)) {
GC_TRACE_LOG("freeing %p\n", al->user_data);
// GC_TRACE_LOG("freeing %p\n", al->user_data);
b->isfree.set(atom_idx);
#ifndef NDEBUG
memset(al->user_data, 0xbb, b->size - sizeof(GCAllocation));
......
......@@ -708,7 +708,7 @@ void BoxedDictIterator::gcHandler(GCVisitor* v, Box* b) {
}
void BoxedDictView::gcHandler(GCVisitor* v, Box* b) {
assert(b->cls == dict_items_cls);
assert(b->cls == dict_items_cls || b->cls == dict_values_cls || b->cls == dict_keys_cls);
Box::gcHandler(v, b);
BoxedDictView* view = static_cast<BoxedDictView*>(b);
......
......@@ -3696,7 +3696,7 @@ Box* callCLFunc(CLFunction* f, CallRewriteArgs* rewrite_args, int num_output_arg
ASSERT(chosen_cf->spec->rtn_type->isFitBy(r->cls), "%s (%p) was supposed to return %s, but gave a %s",
g.func_addr_registry.getFuncNameAtAddress(chosen_cf->code, true, NULL).c_str(), chosen_cf->code,
chosen_cf->spec->rtn_type->debugName().c_str(), r->cls->tp_name);
assert(!PyErr_Occurred());
ASSERT(!PyErr_Occurred(), "%p", chosen_cf->code);
}
return r;
......
......@@ -128,6 +128,7 @@ int BoxedTuple::Resize(BoxedTuple** pv, size_t newsize) noexcept {
BoxedTuple* resized = new (newsize) BoxedTuple();
memmove(resized->elts, t->elts, sizeof(Box*) * t->size());
memset(resized->elts + t->size(), 0, sizeof(Box*) * (newsize - t->size()));
*pv = resized;
return 0;
......
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