TNO / Rewriters-Ada

Advanced manipulation of Ada code
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

If-Expression rewrite fails on hac #4

Open pjljvandelaar opened 2 years ago

pjljvandelaar commented 2 years ago

On file hacadacompiler-code\src\compile\hac_sys-multi_precision_integers.adb

==== If_Expression ====

fails on the function:

  function Equal (i1, i2 : Multi_int) return Boolean is
  begin
    if i1.zero and then i2.zero then
      return True;
    end if;

    if i1.zero = i2.zero and then
       i1.neg  = i2.neg  and then
       i1.last_used = i2.last_used
    then
      return i1.blk (0 .. i1.last_used) = i2.blk (0 .. i2.last_used);
    else
      return False;
    end if;
  end Equal;

Are we handling the context right?