}
}
+StackFrame::~StackFrame() {
+ if (module != NULL) {
+ delete [] module;
+ }
+ if (function != NULL) {
+ delete [] function;
+ }
+ if (filename != NULL) {
+ delete [] filename;
+ }
+}
+
// bool cast
bool Null ::toBool(void) const { return false; }
void Visitor::visit(Blob *) { assert(0); }
void Visitor::visit(Pointer *) { assert(0); }
void Visitor::visit(Repr *node) { node->machineValue->visit(*this); }
+void Visitor::visit(Backtrace *) { assert(0); }
+void Visitor::visit(StackFrame *) { assert(0); }
static Null null;
const Value & Value::operator[](size_t index) const {
- const Array *array = dynamic_cast<const Array *>(this);
+ const Array *array = toArray();
if (array) {
if (index < array->values.size()) {
return *array->values[index];