Yengine: only retry compile if there was a object file in cache with wrong version or signature
parent
2dc49dc1e9
commit
2369ce413d
|
@ -6540,14 +6540,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
|||
|
||||
public class CVVMismatchException: Exception
|
||||
{
|
||||
public int oldcvv;
|
||||
public int newcvv;
|
||||
|
||||
public CVVMismatchException(int oldcvv, int newcvv) : base("object version is " + oldcvv.ToString() +
|
||||
" but accept only " + newcvv.ToString())
|
||||
public CVVMismatchException(string msg) : base(msg)
|
||||
{
|
||||
this.oldcvv = oldcvv;
|
||||
this.newcvv = newcvv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,13 +124,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
|||
finally
|
||||
{
|
||||
// In case something went wrong writing temp file, delete it.
|
||||
try
|
||||
{
|
||||
File.Delete (tmpFileName);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
File.Delete (tmpFileName);
|
||||
}
|
||||
|
||||
// Since we just wrote the .xmrobj file, maybe save disassembly.
|
||||
|
|
|
@ -90,12 +90,12 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
|||
// Check version number to make sure we know how to process file contents.
|
||||
char[] ocm = objFileReader.ReadChars(ScriptCodeGen.OBJECT_CODE_MAGIC.Length);
|
||||
if(new String(ocm) != ScriptCodeGen.OBJECT_CODE_MAGIC)
|
||||
throw new Exception("not an Yengine object file (bad magic)");
|
||||
throw new CVVMismatchException("Not an Yengine object file (bad magic)");
|
||||
|
||||
int cvv = objFileReader.ReadInt32();
|
||||
if(cvv != ScriptCodeGen.COMPILED_VERSION_VALUE)
|
||||
throw new CVVMismatchException(cvv, ScriptCodeGen.COMPILED_VERSION_VALUE);
|
||||
|
||||
throw new CVVMismatchException(
|
||||
"Object version is " + cvv.ToString() + " but accept only " + ScriptCodeGen.COMPILED_VERSION_VALUE.ToString());
|
||||
// Fill in simple parts of scriptObjCode object.
|
||||
sourceHash = objFileReader.ReadString();
|
||||
glblSizes.ReadFromFile(objFileReader);
|
||||
|
|
|
@ -1283,7 +1283,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
|||
{
|
||||
initerr = e1;
|
||||
}
|
||||
if((initerr != null) && !instance.m_ForceRecomp)
|
||||
if(initerr != null && !instance.m_ForceRecomp && initerr is CVVMismatchException)
|
||||
{
|
||||
UUID itemID = instance.m_ItemID;
|
||||
Verbose("[YEngine]: {0}/{2} first load failed ({1}), retrying after recompile",
|
||||
|
|
Loading…
Reference in New Issue