Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serious FOR bug in latest dev build s1964
I have seen those warnings for other undefined variables but unfortunately there is no such warning if first use is a FOR (unless I specify --explicit) so that should probably be fixed at least. After testing some more, I also found the same problem occurs where ever the (upper-range + step) exceeds a type boundary like 65535, -128 etc.

I was curious enough to hack a fix myself though it probably needs to be thought threw a bit more by someone more familiar with the compiler such as yourself. Anyway here it is:

If line 1351:
id_type = common_type(common_type(p[4], p[6]), p[7])
is changed to these two lines:
beyond = make_number(p[6].value + p[7].value,p.lineno(2)) # upperbound + step
id_type = common_type(common_type(p[4], beyond), p[7])

that seems to fix the problem Smile

Messages In This Thread

Forum Jump:

Users browsing this thread: 1 Guest(s)