fix #2981
This commit is contained in:
parent
2dbe47c613
commit
b04ada66d0
|
|
@ -77,6 +77,7 @@ namespace CodeCompletion
|
|||
if (Header[i] != PCUFile.Header[i])
|
||||
return false;
|
||||
pcu_file.Version = br.ReadInt16();
|
||||
pcu_file.Revision = br.ReadInt32();
|
||||
pcu_file.CRC = br.ReadInt64();
|
||||
pcu_file.IncludeDebugInfo = br.ReadBoolean();
|
||||
return true;
|
||||
|
|
@ -96,7 +97,7 @@ namespace CodeCompletion
|
|||
{
|
||||
//(ssyy) DarkStar - Ïî÷åìó áû â ýòîì ñëó÷àå ïðîñòî íå ïåðåêîìïèëèðîâàòü ìîäóëü?
|
||||
CloseUnit();
|
||||
throw new InvalidPCUFule(unit_name);
|
||||
throw new InvalidPCUFile(unit_name);
|
||||
}
|
||||
|
||||
private void ReadPCUHeader()
|
||||
|
|
|
|||
|
|
@ -4181,7 +4181,7 @@ namespace PascalABCCompiler
|
|||
return true;
|
||||
}
|
||||
}
|
||||
catch (InvalidPCUFule)
|
||||
catch (InvalidPCUFile)
|
||||
{
|
||||
//Перекомпилируем....
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ namespace PascalABCCompiler.PCU
|
|||
{
|
||||
public static class PCUFileFormatVersion
|
||||
{
|
||||
public static System.Int16 Version = 119;
|
||||
public static System.Int16 Version = 120;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ namespace PascalABCCompiler.PCU
|
|||
BeginReadTree, EndReadTree, BeginSaveTree, EndSaveTree, ErrorSaveTree
|
||||
}
|
||||
|
||||
public class InvalidPCUFule: PascalABCCompiler.Errors.LocatedError
|
||||
public class InvalidPCUFile: PascalABCCompiler.Errors.LocatedError
|
||||
{
|
||||
internal string UnitName;
|
||||
public InvalidPCUFule(string UnitName)
|
||||
public InvalidPCUFile(string UnitName)
|
||||
{
|
||||
this.UnitName = UnitName;
|
||||
}
|
||||
|
|
@ -263,6 +263,7 @@ namespace PascalABCCompiler.PCU
|
|||
ms = new MemoryStream(File.ReadAllBytes(FileName));
|
||||
br = new BinaryReader(ms);
|
||||
ReadPCUHeader();
|
||||
|
||||
units[FileName] = this;
|
||||
unit = new CompilationUnit();
|
||||
unit.UnitFileName = FileName;
|
||||
|
|
@ -543,9 +544,8 @@ namespace PascalABCCompiler.PCU
|
|||
|
||||
private void InvalidUnitDetected()
|
||||
{
|
||||
//(ssyy) DarkStar - Почему бы в этом случае просто не перекомпилировать модуль?
|
||||
CloseUnit();
|
||||
throw new InvalidPCUFule(unit_name);
|
||||
throw new InvalidPCUFile(unit_name);
|
||||
}
|
||||
|
||||
private static bool ReadPCUHead(PCUFile pcu_file, BinaryReader br)
|
||||
|
|
@ -555,6 +555,7 @@ namespace PascalABCCompiler.PCU
|
|||
if (Header[i] != PCUFile.Header[i])
|
||||
return false;
|
||||
pcu_file.Version = br.ReadInt16();
|
||||
pcu_file.Revision = br.ReadInt32();
|
||||
pcu_file.CRC = br.ReadInt64();
|
||||
pcu_file.UseRtlDll = br.ReadBoolean();
|
||||
pcu_file.IncludeDebugInfo = br.ReadBoolean();
|
||||
|
|
@ -564,7 +565,7 @@ namespace PascalABCCompiler.PCU
|
|||
//чтение заголовка PCU
|
||||
private void ReadPCUHeader()
|
||||
{
|
||||
if (!ReadPCUHead(pcu_file, br) || PCUFile.SupportedVersion != pcu_file.Version)
|
||||
if (!ReadPCUHead(pcu_file, br) || PCUFile.SupportedVersion != pcu_file.Version || PCUFile.SupportedRevision != pcu_file.Revision)
|
||||
InvalidUnitDetected();
|
||||
|
||||
if(pcu_file.IncludeDebugInfo)
|
||||
|
|
|
|||
|
|
@ -159,9 +159,9 @@ namespace PascalABCCompiler.PCU
|
|||
public static char[] Header = new char[3] { 'P', 'C', 'U'};
|
||||
|
||||
public static Int16 SupportedVersion = PCUFileFormatVersion.Version;
|
||||
|
||||
public static int SupportedRevision = Convert.ToInt32(RevisionClass.Revision);
|
||||
public Int16 Version;
|
||||
|
||||
public int Revision;
|
||||
public static int CRCOffset = 3 + 2;
|
||||
|
||||
public Int64 CRC;
|
||||
|
|
@ -428,6 +428,7 @@ namespace PascalABCCompiler.PCU
|
|||
pcu_file.imp_entitles[i] = imp_entitles[i];
|
||||
fbw.Write(PCUFile.Header);
|
||||
fbw.Write(PCUFile.SupportedVersion);
|
||||
fbw.Write(Convert.ToInt32(RevisionClass.Revision));
|
||||
fbw.Write((Int64)0);//CRC32
|
||||
fbw.Write(pcu_file.UseRtlDll);
|
||||
fbw.Write(pcu_file.IncludeDebugInfo);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "9";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "3412";
|
||||
public const string Revision = "3414";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=0
|
||||
%REVISION%=3412
|
||||
%REVISION%=3414
|
||||
%MINOR%=9
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.9.0.3412
|
||||
3.9.0.3414
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.9.0.3412'
|
||||
!define VERSION '3.9.0.3414'
|
||||
|
|
|
|||
Loading…
Reference in a new issue