mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 02:52:24 +00:00
Fix overenthusiastic deletion of .sym files for -F forcenewym. Whoops.
This commit is contained in:
parent
28d4bc8219
commit
5c5ca01dbc
3 changed files with 22 additions and 20 deletions
|
|
@ -22,7 +22,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *)
|
||||||
OPV.Module(p);
|
OPV.Module(p);
|
||||||
IF OPM.noerr THEN
|
IF OPM.noerr THEN
|
||||||
IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN
|
IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN
|
||||||
OPM.DeleteNewSym(OPT.SelfName);
|
OPM.DeleteSym(OPT.SelfName);
|
||||||
OPM.LogVT100(VT100.Green); OPM.LogWStr(" Main program."); OPM.LogVT100(VT100.ResetAll);
|
OPM.LogVT100(VT100.Green); OPM.LogWStr(" Main program."); OPM.LogVT100(VT100.ResetAll);
|
||||||
ELSE
|
ELSE
|
||||||
IF new THEN
|
IF new THEN
|
||||||
|
|
@ -34,7 +34,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *)
|
||||||
END
|
END
|
||||||
END;
|
END;
|
||||||
ELSE
|
ELSE
|
||||||
OPM.DeleteNewSym(OPT.SelfName)
|
OPM.DeleteSym(OPT.SelfName)
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END;
|
END;
|
||||||
|
|
|
||||||
|
|
@ -339,8 +339,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
||||||
IF verbose IN Options THEN VerboseListSizes END;
|
IF verbose IN Options THEN VerboseListSizes END;
|
||||||
|
|
||||||
ResourceDir := InstallDir;
|
ResourceDir := InstallDir;
|
||||||
Strings.Append("/", ResourceDir);
|
IF ResourceDir[0] # 0X THEN
|
||||||
Strings.Append(Model, ResourceDir);
|
Strings.Append("/", ResourceDir);
|
||||||
|
Strings.Append(Model, ResourceDir);
|
||||||
|
END;
|
||||||
|
|
||||||
modules := ""; Platform.GetEnv("MODULES", modules);
|
modules := ""; Platform.GetEnv("MODULES", modules);
|
||||||
searchpath := "."; Platform.GetEnv("OBERON", searchpath);
|
searchpath := "."; Platform.GetEnv("OBERON", searchpath);
|
||||||
|
|
@ -592,18 +594,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
||||||
BEGIN
|
BEGIN
|
||||||
oldSFile := NIL; done := FALSE;
|
oldSFile := NIL; done := FALSE;
|
||||||
MakeFileName(modName, fileName, SFext);
|
MakeFileName(modName, fileName, SFext);
|
||||||
IF forcenewsym IN Options THEN
|
oldSFile := Files.Old(fileName); done := oldSFile # NIL;
|
||||||
Files.Delete(fileName, res)
|
IF done THEN
|
||||||
ELSE
|
Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver);
|
||||||
oldSFile := Files.Old(fileName); done := oldSFile # NIL;
|
IF (tag # SFtag) OR (ver # SFver) THEN
|
||||||
IF done THEN
|
(* Possibly a symbol file from another Oberon implementation, e.g. HP-Oberon,
|
||||||
Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver);
|
or from a symbol incompatible version of this Oberon. *)
|
||||||
IF (tag # SFtag) OR (ver # SFver) THEN
|
IF ~(newsf IN Options) THEN err(-306) END;
|
||||||
(* Possibly a symbol file from another Oberon implementation, e.g. HP-Oberon,
|
CloseOldSym; done := FALSE
|
||||||
or from a symbol incompatible version of this Oberon. *)
|
|
||||||
IF ~(newsf IN Options) THEN err(-306) END;
|
|
||||||
CloseOldSym; done := FALSE
|
|
||||||
END
|
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END OldSym;
|
END OldSym;
|
||||||
|
|
@ -642,10 +640,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
||||||
IF (modName # "SYSTEM") OR (mainprog IN Options) THEN Files.Register(newSFile) END
|
IF (modName # "SYSTEM") OR (mainprog IN Options) THEN Files.Register(newSFile) END
|
||||||
END RegisterNewSym;
|
END RegisterNewSym;
|
||||||
|
|
||||||
PROCEDURE DeleteNewSym*(VAR modulename: ARRAY OF CHAR);
|
PROCEDURE DeleteSym*(VAR modulename: ARRAY OF CHAR);
|
||||||
VAR fn: FileName; res: INTEGER;
|
VAR fn: FileName; res: INTEGER;
|
||||||
BEGIN MakeFileName(modulename, fn, SFext); Files.Delete(fn, res)
|
BEGIN MakeFileName(modulename, fn, SFext); Files.Delete(fn, res)
|
||||||
END DeleteNewSym;
|
END DeleteSym;
|
||||||
|
|
||||||
PROCEDURE DeleteObj*(VAR modulename: ARRAY OF CHAR);
|
PROCEDURE DeleteObj*(VAR modulename: ARRAY OF CHAR);
|
||||||
VAR fn: FileName; res: INTEGER;
|
VAR fn: FileName; res: INTEGER;
|
||||||
|
|
|
||||||
|
|
@ -1047,7 +1047,11 @@ BEGIN
|
||||||
ELSE
|
ELSE
|
||||||
impCtxt.nofr := FirstRef(*Comp+1*); impCtxt.minr := maxStruct; impCtxt.nofm := 0;
|
impCtxt.nofr := FirstRef(*Comp+1*); impCtxt.minr := maxStruct; impCtxt.nofm := 0;
|
||||||
impCtxt.self := aliasName = "@self"; impCtxt.reffp := 0;
|
impCtxt.self := aliasName = "@self"; impCtxt.reffp := 0;
|
||||||
OPM.OldSym(name, done);
|
IF impCtxt.self & (OPM.forcenewsym IN OPM.Options) THEN
|
||||||
|
OPM.DeleteSym(name); done := FALSE
|
||||||
|
ELSE
|
||||||
|
OPM.OldSym(name, done)
|
||||||
|
END;
|
||||||
IF done THEN
|
IF done THEN
|
||||||
InMod(mno); InLinks;
|
InMod(mno); InLinks;
|
||||||
impCtxt.nextTag := OPM.SymRInt();
|
impCtxt.nextTag := OPM.SymRInt();
|
||||||
|
|
@ -1282,7 +1286,7 @@ END Import;
|
||||||
END;
|
END;
|
||||||
newsf := FALSE; symNew := FALSE; (* because of call to FPrintErr from OPL *)
|
newsf := FALSE; symNew := FALSE; (* because of call to FPrintErr from OPL *)
|
||||||
IF ~OPM.noerr OR findpc THEN
|
IF ~OPM.noerr OR findpc THEN
|
||||||
OPM.DeleteNewSym(SelfName)
|
OPM.DeleteSym(SelfName)
|
||||||
END
|
END
|
||||||
(* OPM.RegisterNewSym is called in OP2 after writing the object file *)
|
(* OPM.RegisterNewSym is called in OP2 after writing the object file *)
|
||||||
END
|
END
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue