-----Original Message----- From: gpc-owner@gnu.de [mailto:gpc-owner@gnu.de]On Behalf Of Frank Heckenbach Sent: 11 November 2001 07:58 To: gpc@gnu.de Subject: Re: Bug Report: goto bug
J. David Bryan wrote:
I note from the generated code on the x86 processor that the jump is indirect through a location on the stack. Does the Sparc
object to this?
I seem to recall that certain processors don't allow jumps to
code on the
stack; might that possibly extend to jumps through the stack as well?
This seems strange at first (*), but would explain why it doesn't crash for me on Solaris. If so, then noexec_user_stack must have been set on your system, and unsetting it will avoid the crash. Can you try this?
(*) Quite strange, actually, since then any parameters and local variables of procedural type would not work.
It is not set (althought my Ultra is a machine where it could be - it's a sun4u). I have attached my /etc/system so you can see it isn't set. What's more I compiled and ran the program below (from the GPC Pascal Manual) that demonstrates procedure parameters working (from what I understood from (*)).
In case it's of use to someone I have attached the assembler (gpc -S) and it appears to be on the assembler "restore" that the SIGSEV occurs. If there is more info I can provide just let me know (and probably tell me how).
Cheers, Martin.
program LocalProceduralParameterDemo;
procedure CallProcedure (procedure Proc); begin Proc end;
procedure MainProcedure; var LocalVariable : Integer;
procedure LocalProcedure; begin WriteLn (LocalVariable) end;
begin LocalVariable := 42; CallProcedure (LocalProcedure) end;
begin MainProcedure end.
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html