Menu ▾ ▴

#663 IF conditions weird behaviour

GC 3.1
closed
expressions (5)
6
2020-07-17
2020-07-17
No

Using 3.1:


if person less or equal 0 display "true" end-if. > OK
if person
not less or equal 0 display "true" end-if. > OK
BUT:
if person less or equals 0 display "true" end-if. > OK
if person
not less or equals 0 display "true" end-if. > error: invalid expression

One would expect not less or equals 0 to be OK, same as not less or equal 0 is.


if person not (less or equals) 0 display "true" end-if. *> attempt to reference unallocated memory (signal SIGSEGV)


Related

Bugs: #661

Discussion

  • Edward Hart

    Edward Hart - 2020-07-17
    • labels: --> expressions
    • status: open --> accepted
    • assigned_to: Edward Hart
    • Group: unclassified --> GC 3.1
    • Priority: 5 - default --> 6
     
  • Edward Hart

    Edward Hart - 2020-07-17

    Thank for the report, Nikos! I can reproduce both issues.

     
    • Nikos Papageorgiou

      You are welcome Edward, I am glad I can help.

      I really like this project and have used the last 2 months trying to make an IDE plugin, so I try to type all sorts of weird things to see if they are allowed and therefore whether the plugin should display errors/warnings etch.

      So I have found a few of these things already, also https://sourceforge.net/p/open-cobol/bugs/661/

       

      Last edit: Nikos Papageorgiou 2020-07-17
  • Edward Hart

    Edward Hart - 2020-07-17
    • status: accepted --> closed
     
  • Edward Hart

    Edward Hart - 2020-07-17

    Fixed in [r3713] and merged to gnucobol-3.x in [r3714].

     

Log in to post a comment.