Skip to content

Commit

Permalink
Runtime: make types explicit when reading [gc_regs] (#3453)
Browse files Browse the repository at this point in the history
Runtime4: make types explicit when reading [gc_regs].
  • Loading branch information
gretay-js authored Jan 13, 2025
1 parent 67e6eb3 commit b487f71
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions runtime4/roots_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,7 @@ void caml_do_local_roots_nat(scanning_action maj, scanning_action min,
value * regs;
frame_descr * d;
uintnat h;
int i, j, n, ofs;
unsigned short * p;
int i, j;
value * root;
struct caml__roots_block *lr;

Expand All @@ -678,17 +677,21 @@ void caml_do_local_roots_nat(scanning_action maj, scanning_action min,
for (p = dl->live_ofs, n = dl->num_live; n > 0; n--, p++) {
uint32_t ofs = *p;
if (ofs & 1) {
root = regs + (ofs >> 1);
/* Negative offset to scan xmm registers in amd64. */
root = regs + (((int32_t)ofs) >> 1);
} else {
root = (value *)(sp + ofs);
}
visit(maj, min, root);
}
} else {
unsigned short * p;
unsigned short n;
for (p = d->live_ofs, n = d->num_live; n > 0; n--, p++) {
ofs = *p;
unsigned short ofs = *p;
if (ofs & 1) {
root = regs + (ofs >> 1);
/* Negative offset to scan xmm registers in amd64. */
root = regs + (((signed short)ofs) >> 1);
} else {
root = (value *)(sp + ofs);
}
Expand Down

0 comments on commit b487f71

Please sign in to comment.