Project

General

Profile

Actions

Bug #164

closed

Procedure with using locate command inside

Added by Anonymous almost 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
02/08/2020
Due date:
% Done:

0%

Estimated time:
Affected version:

Description

If i use this procedure below bottom it works fine as it should and prints name$,b,c. But if i then remove // for the locate command to work inside the procedure,it comes up with error very bottom below.

// functions

name$="hello there"
b=10
c=16
test[b,c,name$]

Procedure test[b,c,name$]
//locate b,c
print name$,b,c
End Proc
Error

Compiling c:/Users/maleh/Documents/AOZ Studio Applications/applications/Test1, emulation: 1200, speed: fast.
First pass...
Second pass...
main.aoz:1:1: Compiler error: crash during compilation: pass: 2
cannot read property 'definition' of undefined
typeerror: cannot read property 'definition' of undefined
    at secondpass (c:\snapshot\compiler\compiler.js:0:0)
    at object.module.exports.compile (c:\snapshot\compiler\compiler.js:0:0)
    at compile (c:\snapshot\compiler\aoz.js:0:0)
    at aoz (c:\snapshot\compiler\aoz.js:0:0)
    at object.<anonymous> (c:\snapshot\compiler\aoz.js:0:0)
    at module._compile (pkg/prelude/bootstrap.js:1261:22)
    at object.module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at module.load (internal/modules/cjs/loader.js:651:32)
    at trymoduleload (internal/modules/cjs/loader.js:591:12)
    at function.module._load (internal/modules/cjs/loader.js:583:3)

Internal error
Task failed, no code generated...
Actions #1

Updated by Brian Flanagan almost 5 years ago

Cannot duplicate. Is there something else in your code that could cause the compiler crash?
Just using the code you posted, with or without the comment on the Locate command, it works fine.

I also tried it with an Amiga manifest, a PC manifest, and no manifest specified. It still works in any of these configurations.

Here's what I tested:

#manifest: "amiga"
#speed: "safe"

name$="hello there"
b=10
c=16
test[b,c,name$]

Procedure test[b,c,name$]
Locate b,c
Print name$,b,c
End Proc
Actions #2

Updated by Francois Lionet almost 5 years ago

  • Status changed from New to Feedback
  • Assignee set to Francois Lionet
  • Target version set to 0.9.5

Me too, I cannot duplicate. But this "false bug" (maybe not) allowed me to correct false warnings for the variables included in the procedure call (here, name$, x and y) being seen as "undeclared".
Thanks!
I close the bug if no news in the next version... ;)

Actions #3

Updated by Baptiste Pillot over 4 years ago

  • Description updated (diff)

Console :

Cannot read property 'loChar' of undefined
aoz.js:418 TypeError: Cannot read property 'loChar' of undefined
    at Fonts.getAmigaCharacter (fonts.js:440)
    at Fonts.drawAmigaText (fonts.js:428)
    at TextWindow.printLine (textwindow.js:1648)
    at TextWindow.print (textwindow.js:1241)
    at proctest.blocks.<computed> (application.js:88)
    at doUpdate (aoz.js:405)

It compiles, but runs with a crash.

Actions #4

Updated by Brian Flanagan about 4 years ago

  • Status changed from Feedback to Closed

Re-tested in 0.9.9.4-RC1

It's working now.

Actions

Also available in: Atom PDF