tebe6502 / Mad-Pascal

Mad Pascal Compiler for 6502 (Atari XE/XL, C64, C4Plus, Neo6502)
122 stars 20 forks source link

using the `fdiv` variable name when dividing with floating point `float` / `single` causes a hangup #101

Closed GSoftwareDevelopment closed 2 years ago

GSoftwareDevelopment commented 2 years ago
uses crt;

const
  freq_ratio = 4;

var
  freq:float;
  fdiv:byte;
  tpq:longint;
  qtm:longint;

begin
  qtm:=454545;
  tpq:=120;
  freq:=1/((qtm/1000000)/tpq)*freq_ratio;
  fdiv:=round(64000/freq);
  writeLn(fdiv);
end.

The above code will cause the computer to hang. This is because a variable named fdiv is used, which conflicts with a math procedure of the same name.

tebe6502 commented 2 years ago

issue #101 fixed

GSoftwareDevelopment commented 2 years ago

Thank you :)