Bug #165

adding a check for passing guarded function result as VAR parameter

Added by J. Templ over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:07/12/2017
Priority:NormalDue date:
Assignee:J. Templ% Done:

0%

Category:-
Target version:1.7.1
Forum topic:https://forum.blackboxframework.org/viewtopic.php?f=40&t=645

Description

If a function returns a pointer and that result is guarded to some extended type it can be passed as a VAR parameter. This leads to an illegal instruction TRAP at runtime. The compiler should report an error in such a case. For a test case see https://forum.oberoncore.ru/viewtopic.php?f=127&t=6081 .

Reported by Ilya Ermakov of oberoncore, 2017-07-07.

Associated revisions

Revision 7d317204
Added by J. Templ over 1 year ago

adding a check for passing guarded function result as VAR parameter. Refs: #165.
As proposed by luowy/Ilya Ermakov.

Signed-off-by: Josef Templ <>

Revision 754cfa26
Added by J. Templ over 1 year ago

NotVar applied recursively also for SYSTEM.VAL. Refs: #165.
The meaning is: if SYSTEM.VAL is applied to something that is not a variable, then
the result is also not a variable.
Such a case is hard to produce because the compiler normally does not generate a SYSTEM.VAL node
when converting a pointer. However, there are (rarely used) options that turn on the generation
of SYSTEM.VAL nodes in such cases.
Using NotVar recursively makes the code easier to read and also covers such exotic cases.

Signed-off-by: Josef Templ <>

History

#1 Updated by R. Campbell over 1 year ago

  • Forum topic set to https://forum.blackboxframework.org/viewtopic.php?f=40&t=645

#2 Updated by R. Campbell over 1 year ago

  • Status changed from New to Closed

Also available in: Atom PDF