Skip to content

Commit

Permalink
fix undefined left shift of negative value.
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16520 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
gasche committed Oct 17, 2015
1 parent 41a8aa5 commit 24c118d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion byterun/caml/mlvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef uintnat mark_t;

/* Conversion macro names are always of the form "to_from". */
/* Example: Val_long as in "Val from long" or "Val of long". */
#define Val_long(x) (((intnat)(x) << 1) + 1)
#define Val_long(x) ((intnat) (((uintnat)(x) << 1)) + 1)
#define Long_val(x) ((x) >> 1)
#define Max_long (((intnat)1 << (8 * sizeof(value) - 2)) - 1)
#define Min_long (-((intnat)1 << (8 * sizeof(value) - 2)))
Expand Down

0 comments on commit 24c118d

Please sign in to comment.