The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

runtime/mlvalues.h: more careful definition of Tag_val (#12703)

The offset `- sizeof(value)` should be signed, otherwise pointer overflow
can (formally) occur.

Fixes: #12528

authored by

Xavier Leroy and committed by
GitHub
6bad0321 a62f7fb6

+5 -1
+4
Changes
··· 529 529 (Miod Vallat and Xavier Leroy, report by Jan Midtgaard, review by 530 530 KC Sivaramakrishnan) 531 531 532 + - #12528, #12703: Avoid pointer arithmetic overflow in Tag_val macro 533 + (very likely harmless, but can trigger alarms) 534 + (Xavier Leroy, report by Sam Goldman, review by Guillaume Munch-Maccagnoni) 535 + 532 536 - #12593: TSan should handle Effect.Unhandled correctly 533 537 (Fabrice Buoro and Olivier Nicole, report by Jan Midtgaard and Miod Vallat, 534 538 review by Gabriel Scherer)
+1 -1
runtime/caml/mlvalues.h
··· 205 205 #define Tag_hp(hp) (((volatile unsigned char *) (hp)) [sizeof(value)-1]) 206 206 /* Also an l-value. */ 207 207 #else 208 - #define Tag_val(val) (((volatile unsigned char *) (val)) [-sizeof(value)]) 208 + #define Tag_val(val) (((volatile unsigned char *) (val)) [- (int)sizeof(value)]) 209 209 /* Also an l-value. */ 210 210 #define Tag_hp(hp) (((volatile unsigned char *) (hp)) [0]) 211 211 /* Also an l-value. */