Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/Execution/binfile/binfile.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Execution/binfile/binfile.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 985, Wed Nov 21 19:09:12 2001 UTC revision 986, Wed Nov 21 21:03:17 2001 UTC
# Line 334  Line 334 
334               executable = ref NONE }               executable = ref NONE }
335    
336      (* must be called with second arg >= 0 *)      (* must be called with second arg >= 0 *)
337      fun readCodeList (strm, name, nbytes) = let      fun readCodeList (strm, nbytes) = let
338          fun readCode 0 = []          fun readCode 0 = []
339            | readCode n = let            | readCode n = let
340                  val sz = readInt32 strm                  val sz = readInt32 strm
# Line 342  Line 342 
342              in              in
343                  if n' < 0 then                  if n' < 0 then
344                      error "code size"                      error "code size"
345                  else CodeObj.input(strm, sz, SOME name) :: readCode n'                  else CodeObj.input(strm, sz) :: readCode n'
346              end              end
347          val dataSz = readInt32 strm          val dataSz = readInt32 strm
348          val n' = nbytes - dataSz - 4          val n' = nbytes - dataSz - 4
# Line 353  Line 353 
353            | [] => error "missing code objects"            | [] => error "missing code objects"
354      end      end
355    
356      fun read { arch, version, name, stream = s } = let      fun read { arch, version, stream = s } = let
357          val MAGIC = mkMAGIC (arch, version)          val MAGIC = mkMAGIC (arch, version)
358          val magic = bytesIn (s, magicBytes)          val magic = bytesIn (s, magicBytes)
359          val _ = if magic = MAGIC then () else error "bad magic number"          val _ = if magic = MAGIC then () else error "bad magic number"
# Line 386  Line 386 
386          (* skip padding *)          (* skip padding *)
387          val _ = if pad <> 0 then ignore (bytesIn (s, pad)) else ()          val _ = if pad <> 0 then ignore (bytesIn (s, pad)) else ()
388          (* now get the code *)          (* now get the code *)
389          val code = readCodeList (s, name, cs)          val code = readCodeList (s, cs)
390          val penv = bytesIn (s, es)          val penv = bytesIn (s, es)
391      in      in
392          { contents = create { imports = imports,          { contents = create { imports = imports,

Legend:
Removed from v.985  
changed lines
  Added in v.986

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0