andrew-johnson-4 / lambda-mountain

Compact Portable Assembler (5K SLOC)
MIT License
12 stars 0 forks source link

Invalid memory regions with complex if conditions #443

Closed andrew-johnson-4 closed 3 weeks ago

andrew-johnson-4 commented 1 month ago
typecheck-annotate-size := λ(: tt Type). (: (tail(
   (if (typecheck-is-sized tt) () (
      (if (==( (typecheck-is-sized tt) typecheck-do-not-size )) () (tail(
         (let sz (typecheck-annotate-size-inner tt))
         (let tt2 (maybe-deref(typecheck-annotate-size-recurse tt)))
         (let tt3 (maybe-deref(tand(
            tt2
            (TGround(
               'Sized_s
               (close (TypeSeq(
                  (close TypeEOF)
                  (TGround(
                     (to-string sz)
                     (close TypeEOF)
                  ))
               )))
            ))
         ))))
         (set tt tt3)
      )))
   ))
   tt
)) Type);
andrew-johnson-4 commented 4 weeks ago

This has something to do with the tail condition. The bug doesn't happen in the true branch.

andrew-johnson-4 commented 3 weeks ago

The return position is the problem, dup.