[M3commit] [modula3/cm3] b440a9: Fix segfault in llvm backend, on p079.

GitHub noreply at github.com
Sat Aug 12 20:20:56 CEST 2017


  Branch: refs/heads/master
  Home:   https://github.com/modula3/cm3
  Commit: b440a9ea6b67f99201c47ae33078587ed526c192
      https://github.com/modula3/cm3/commit/b440a9ea6b67f99201c47ae33078587ed526c192
  Author: Rodney Bates <rodney.m.bates at acm.org>
  Date:   2017-08-12 (Sat, 12 Aug 2017)

  Changed paths:
    M m3-sys/llvm3.6.1/src/M3CG_LLVM.m3
    M m3-sys/llvmbindings/src/LLVM.i3

  Log Message:
  -----------
  Fix segfault in llvm backend, on p079.

There is a very subtle and heretofore undocumented invariant concerning
what procedure declare_param and declare_local IR operators belong to.

>From an experiment, it appears that declare_local occurences in a
procedure signature (i.e., following a declare_procedure, not in the
body) are not duplicated when the signature for the same procedure
is imported, via import_procedure and its following occurences of
declare_param.

This is important, because an imported signature, with its parameters,
can occur inside a procedure body, where declare_local can also occur.
Were it not so, a declare_local in this context would be ambiguous as
to whether it belonged to the most recent import_procedure or to the
current body.


  Commit: ce560936a064683d428ab0a1449ad6ba3d9eecd8
      https://github.com/modula3/cm3/commit/ce560936a064683d428ab0a1449ad6ba3d9eecd8
  Author: Rodney Bates <rodney.m.bates at acm.org>
  Date:   2017-08-12 (Sat, 12 Aug 2017)

  Changed paths:
    M m3-sys/m3middle/src/M3CG_Ops.i3

  Log Message:
  -----------
  Document what declare_param belongs to.

declare_local occurences in a procedure signature (i.e., following a
declare_procedure, not in the body) are not duplicated when the
signature for the same procedure is imported, via import_procedure and
its following occurences of declare_param.

This is important, because an imported signature, with its parameters,
can occur inside a procedure body, where declare_local can also occur.
Were it not so, a declare_local in this context would be ambiguous as
to whether it belonged to the most recent import_procedure or to the
current body.


Compare: https://github.com/modula3/cm3/compare/037ef109e2ae...ce560936a064


More information about the M3commit mailing list