diff --git a/sources/dfmc/harp-cg/harp-main.dylan b/sources/dfmc/harp-cg/harp-main.dylan index c2eecb0b8..069d58afe 100644 --- a/sources/dfmc/harp-cg/harp-main.dylan +++ b/sources/dfmc/harp-cg/harp-main.dylan @@ -1286,18 +1286,23 @@ end method; // types -define method emit-computation (back-end :: , c :: ) => () - // MUST EMIT THESE CAUSE THEY CHECK FOR THINGS LIKE SIZE :: FOR VECTOR - emit-type-check(back-end, - emit-reference(back-end, #f, c.computation-value), - c.type); - next-method(); -end method emit-computation; +define method emit-check-type? + (back-end :: , c :: ) + => (well? :: ) + // Don't emit type checks for the Dylan library + ~compiling-dylan-library?() +end method; + +define method emit-check-type? + (back-end :: , c :: ) + => (well? :: ) + // We must emit these cause they check for things like size :: + // for vector() + #t +end method; define method emit-computation (back-end :: , c :: ) => () - if (compiling-dylan-library?()) - // don't emit type checks for the Dylan library - else + if (emit-check-type?(back-end, c)) emit-type-check(back-end, emit-reference(back-end, #f, c.computation-value), c.type);