summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar leino <unknown>2015-11-27 17:57:47 -0800
committerGravatar leino <unknown>2015-11-27 17:57:47 -0800
commit351bce8912c2ae2159abb0ebe2b1e1ad1a4b4290 (patch)
tree834c41b45c7916ae7d130fa42897beaafdaa884b
parent22e353122e53fbf396f24977eee99cb5991f5455 (diff)
Make cached results dependent on if a function is ghost or not
-rw-r--r--Source/Dafny/Translator.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Dafny/Translator.cs b/Source/Dafny/Translator.cs
index 8e8c3c19..e3915e6d 100644
--- a/Source/Dafny/Translator.cs
+++ b/Source/Dafny/Translator.cs
@@ -3510,10 +3510,13 @@ namespace Microsoft.Dafny {
private void InsertChecksum(Function f, Bpl.Declaration decl, bool specificationOnly = false)
{
+ Contract.Requires(f != null);
+ Contract.Requires(decl != null);
byte[] data;
using (var writer = new System.IO.StringWriter())
{
var printer = new Printer(writer);
+ writer.Write(f.IsGhost ? "function" : "function method");
printer.PrintAttributes(f.Attributes);
printer.PrintFormals(f.Formals);
writer.Write(": ");
@@ -3534,6 +3537,8 @@ namespace Microsoft.Dafny {
private void InsertChecksum(Bpl.Declaration decl, byte[] data)
{
+ Contract.Requires(decl != null);
+ Contract.Requires(data != null);
var md5 = System.Security.Cryptography.MD5.Create();
var hashedData = md5.ComputeHash(data);
var checksum = BitConverter.ToString(hashedData);