Thread View: comp.lang.clu
1 messages
1 total messages
Started by Matti Jokinen
Sun, 27 Dec 1987 22:37
Yet another linker bug + fix
Author: Matti Jokinen
Date: Sun, 27 Dec 1987 22:37
Date: Sun, 27 Dec 1987 22:37
52 lines
1850 bytes
1850 bytes
Description: An attempt to overload a module with more than one parameter
may crash the debugger. The bug appears at least in VAX CLU.
Repeat-by: Compile the following program into c.bin:
c = cluster is create
rep = string
create = proc[t,u: type](x: t, y: u,
p: proctype(t) returns(rep),
q: proctype(u) returns(rep))
returns(cvt)
return(p(x))
end create
end c
Type `debug c', and when the linker prompt appears, type `load("c")'.
Although the symptoms are very similar, this bug is unrelated to the bug
I reported in article 22.
Fix: The true origin of this problem appears to be the following equate
in /usr/clu/link/linker.equ:
params = sequence[constant]
I think it should be
params = oneof[dummy: null, list: sequence[constant]]
However, changing this would cause a number of changes in various parts
of the linker. I am reluctant to maintain a system that differs too
much from the `official' MIT version. Also, these changes may depend on
the linker version you have.
Thus I prefere a quick fix, and fortunately there is one. Redefine the
Copy procedure in /usr/clu/link/clu/constant. The original definition is
Copy = proc (C: cvt) returns (cvt);
return (rep$Copy1(C));
end Copy;
Replace it with
Copy = proc (C: cvt) returns (cvt);
tagcase C
tag a_Null: return(C);
others: return (rep$Copy1(C));
end;
end Copy;
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads