Compiler trap in Real64 op ADR(x)

User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Compiler trap in Real64 op ADR(x)

Post by Robert »

adimetrius wrote:P.S. It seems I can't post at the other discussion page
No!

The policy is described here: https://wiki.blackboxframework.org/inde ... tin_Boards .
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Compiler trap in Real64 op ADR(x)

Post by Josef Templ »

a bug fix as proposed by adimetrius has been prepared for the center version.

Thanks for the careful analysis and bug fix proposal.

- Josef
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Compiler trap in Real64 op ADR(x)

Post by Josef Templ »

adimetrius wrote:For a permanent correction, why not amend CheckForm?

It would be the most 'straight' logic: CheckForm checks that the format of data is correct. It is correct to convert a Pointer to a Real64, and that't what CheckForm should return. Amending other procedures looks as a workaround to me.

Code: Select all

   PROCEDURE CheckForm (form: BYTE; VAR mf: INTEGER);
   BEGIN
      IF form = Real32 THEN mf := 0
      ELSIF form = Real64 THEN mf := 4
      ELSIF form = Int32 THEN mf := 2
      ELSIF form = Pointer THEN mf := 2       (* this is the addition *)
      ELSE ASSERT(form = Int16); mf := 6
      END
   END CheckForm;
P.S. It seems I can't post at the other discussion page
@adimetrius
Are you still convinced that CheckForm is the best place for the fix?
I am asking because we had some discussion in the center about the best place for the fix.
To me it looks very plausible but I want to make sure that the original author of the proposal still supports it.

- Josef
User avatar
adimetrius
Posts: 68
Joined: Sun Aug 04, 2019 1:02 pm

Re: Compiler trap in Real64 op ADR(x)

Post by adimetrius »

Yes, I still believe CheckForm would be the most natural place for the fix.
Post Reply