Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function call with string params bug (*solved*)
#2
If you use only print64("A") and your program exits with a "Drive not ready" error, then something is corrupted. It must always exit with an "OK" message. I've run such test, and it exits with an "Ok" in my case. :?: :?:

It seems there's a memory leak somewhere, but still don't know whether it's in your routine or in my one. Recompiling your program with --debug-memory flag triggers the "Out of memory" error. On the other hand, using just PRINT works ok. :?

Note: a string might also be passed as a NULL (HL = 0), specially when there's been not enough memory (which is the case). Your routine should also check that case before taking BC (Length) from (HL) and (HL + 1)

The following also crashes:
Code:
tmp$ = "1"
print64("A" + tmp$)
This means the temporary string "A1" is not being freed from memory. This could be your routine or the compilers routines. Will investigate further...

Update: It's the compiler. :oops: The routine "free string on return" is not doing so... Fixing... :|
Update II: Seems to be fixed now. It wasn't the STRSLICE routine, but a lowlevel backend instruction for passing temporary strings to functions in args (as you did). Please download new rev1713 from the download page and tell me if it works now (I does work to me) Wink
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)