@@ -460,6 +460,11 @@ void dumpVal(VAL v) {
460460 case CT_STRING:
461461 printf("STR[%s]", v->info.str.str);
462462 break;
463+ case CT_STROFFSET:
464+ printf("OFFSET[");
465+ dumpVal((VAL)(v->info.str_offset->str));
466+ printf("]");
467+ break;
463468 case CT_FWD:
464469 printf("CT_FWD ");
465470 dumpVal((VAL)(v->info.ptr));
@@ -591,15 +596,16 @@ VAL idris_castStrFloat(VM* vm, VAL i) {
591596VAL idris_concat(VM* vm, VAL l, VAL r) {
592597 char *rs = GETSTR(r);
593598 char *ls = GETSTR(l);
594− // dumpVal(l);
595− // printf("\n");
596− Closure* cl = allocate(sizeof(Closure) + GETSTRLEN(l) + GETSTRLEN(r) + 1, 0);
599+ int llen = GETSTRLEN(l);
600+ int rlen = GETSTRLEN(r);
601+
602+ Closure* cl = allocate(sizeof(Closure) + llen + rlen + 1, 0);
597603 SETTY(cl, CT_STRING);
598604 cl->info.str.str = (char*)cl + sizeof(Closure);
599605 strcpy(cl->info.str.str, ls);
600606 strcat(cl->info.str.str, rs);
601607
602− cl->info.str.len = GETSTRLEN(l) + GETSTRLEN(r);
608+ cl->info.str.len = llen + rlen;
603609 return cl;
604610}
605611