The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serious FOR bug in latest dev build s1964
#1
Hi,

First, thanks for the compiler it's my first time playing with it.
I think I've found a nasty bug though.

A FOR loop that goes to 255 causes a hang in latest dev build 1.4.1964. Loops to 254 and 256 etc seem to work OK. It's my first time using the compiler so I don't know if it's a new problem or not. It seems to occur regardless of optimisation level.
Code:
10 FOR n=1 TO 255 20 NEXT n
A portion of the generated asm seems to assume the counter is word sized even though it's just a byte so that may be the problem:
Code:
__LABEL0: ld a, 255 ld hl, (_n - 1) <-- looks a bit dodgy cp h jp nc, __LABEL3
I'm running python 2.7.6 btw.
Hope that's enough to investigate it...

Colm
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)