Change profile recording hook to use 32 bit C long arithmetic rather
authorChris Hanson <org/chris-hanson/cph>
Wed, 29 Apr 1987 20:12:20 +0000 (20:12 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 29 Apr 1987 20:12:20 +0000 (20:12 +0000)
than 24 bit fixnum arithmetic.

v7/src/microcode/utils.c

index 51ce056903c69d0e5ce987247c9cec8faba9243b..8c78f6cae01a04ae9a1d261943b947a63c0ebf60 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utils.c,v 9.26 1987/04/29 19:46:39 cph Exp $ */
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utils.c,v 9.27 1987/04/29 20:12:20 cph Exp $ */
 
 /* This file contains utilities for interrupts, errors, etc. */
 
@@ -892,7 +892,7 @@ record_primitive_entry (primitive)
       ((Get_Fixed_Obj_Slot (Primitive_Profiling_Table)) != NIL))
     {
       Pointer table;
-      long index;
+      long index, old_value;
 
       /* Test for TC_PRIMITIVE_EXTERNAL rather than TC_PRIMITIVE here
         because the compiled code interface will use 0 rather than
@@ -902,11 +902,8 @@ record_primitive_entry (primitive)
         ((Get_Fixed_Obj_Slot (Primitive_Profiling_Table)),
          (((pointer_type (primitive)) == TC_PRIMITIVE_EXTERNAL) ? 1 : 0)));
       index = (1 + (pointer_datum (primitive)));
-      Vector_Set (table, index,
-                 (C_Integer_To_Scheme_Integer
-                  (1 +
-                   (Scheme_Integer_To_C_Integer
-                    (Vector_Ref (table, index))))));
+      Scheme_Integer_To_C_Integer ((Vector_Ref (table, index)), &old_value);
+      Vector_Set (table, index, (C_Integer_To_Scheme_Integer (1 + old_value)));
     }
 }