summaryrefslogtreecommitdiffstats
path: root/byterun/fix_code.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-07-02 18:16:15 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-07-02 18:16:15 +0000
commitb149e67a887edbe66c5159dcc09485862ff3cf55 (patch)
tree5be8990215f73919b29c461d86726e75001e7f07 /byterun/fix_code.c
parentf9ca4fbbeb38d1c1979300f68a9e37b409eb4c7e (diff)
Nouveau module Marshal dans stdlib
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1633 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/fix_code.c')
-rw-r--r--byterun/fix_code.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/byterun/fix_code.c b/byterun/fix_code.c
index d00e77bce..a68cb2f93 100644
--- a/byterun/fix_code.c
+++ b/byterun/fix_code.c
@@ -17,6 +17,7 @@
#include "debugger.h"
#include "fix_code.h"
#include "instruct.h"
+#include "md5.h"
#include "memory.h"
#include "misc.h"
#include "mlvalues.h"
@@ -28,6 +29,7 @@
code_t start_code;
asize_t code_size;
unsigned char * saved_code;
+char code_md5[16];
/* Read the main bytecode block from a file */
@@ -36,11 +38,15 @@ void load_code(fd, len)
asize_t len;
{
int i;
+ struct MD5Context ctx;
code_size = len;
start_code = (code_t) stat_alloc(code_size);
if (read(fd, (char *) start_code, code_size) != code_size)
fatal_error("Fatal error: truncated bytecode file.\n");
+ MD5Init(&ctx);
+ MD5Update(&ctx, (unsigned char *) start_code, code_size);
+ MD5Final(code_md5, &ctx);
#ifdef ARCH_BIG_ENDIAN
fixup_endianness(start_code, code_size);
#endif