Bug #141

Comparison of named empty string with array of SHORTCHAR does not work.

Added by J. Templ about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:11/02/2016
Priority:NormalDue date:
Assignee:J. Templ% Done:

0%

Category:-
Target version:1.7.1
Forum topic:

Description

Comparison of named empty string with array of SHORTCHAR does not work.
Instead of comparing 0X with the first array element, -1 is used.
This seems to be the same kind of bug as #128, which fixed it for assignment.

Reported by Josef Templ, 2016-11-02.

Associated revisions

Revision d5cfe849
Added by J. Templ about 2 years ago

Comparison of named empty string with array of SHORTCHAR does not work. Refs: #141.
The fix is the same as for issue-#128:
It is required to clear the named object in the operand node after turning an empty string comparison into a character comparison.

Signed-off-by: Josef Templ <>

History

#1 Updated by J. Templ about 2 years ago

This test program shows the bug.
It calls HALT instead of HALT.

MODULE Test;

CONST empty = "";
PROCEDURE Do*;
VAR s: ARRAY 10 OF SHORTCHAR;
BEGIN
s := "";
IF s = empty THEN HALT(99)
ELSE HALT(88)
END
END Do;

END Test.

#2 Updated by J. Templ about 2 years ago

@This test program shows the bug.
It calls HALT 88 instead of HALT 99.

MODULE Test;

  CONST empty = "";

  PROCEDURE Do*;
    VAR s: ARRAY 10 OF SHORTCHAR;
  BEGIN
    s := "";
    IF s = empty THEN HALT(99)
    ELSE HALT(88)
    END
  END Do;

END Test.

@

#3 Updated by D. G. Danforth about 2 years ago

  • Status changed from New to Closed

Also available in: Atom PDF