summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-10-28 15:57:25 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-29 20:32:18 -0400
commit01ef3e1fe9cbe0ec7d3f00664aa9b9135c825c7d (patch)
treeedf24659932acc9089c1b131b267ba467582ee31 /rts
parent260e2379f274759817514c678b3cd1c71a38f939 (diff)
downloadhaskell-01ef3e1fe9cbe0ec7d3f00664aa9b9135c825c7d.tar.gz
Interpreter: initialize arity fields of AP_NOUPDs
AP_NOUPD entry code doesn't use the arity field, but not initializing this field confuses printers/debuggers, and also makes testing harder as the field's value changes randomly.
Diffstat (limited to 'rts')
-rw-r--r--rts/Interpreter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/Interpreter.c b/rts/Interpreter.c
index 2a886ff8a4..463ddae18b 100644
--- a/rts/Interpreter.c
+++ b/rts/Interpreter.c
@@ -1423,11 +1423,11 @@ run_BCO:
}
case bci_ALLOC_AP: {
- StgAP* ap;
int n_payload = BCO_NEXT;
- ap = (StgAP*)allocate(cap, AP_sizeW(n_payload));
+ StgAP *ap = (StgAP*)allocate(cap, AP_sizeW(n_payload));
SpW(-1) = (W_)ap;
ap->n_args = n_payload;
+ ap->arity = 0;
// No write barrier is needed here as this is a new allocation
// visible only from our stack
SET_HDR(ap, &stg_AP_info, cap->r.rCCCS)
@@ -1436,11 +1436,11 @@ run_BCO:
}
case bci_ALLOC_AP_NOUPD: {
- StgAP* ap;
int n_payload = BCO_NEXT;
- ap = (StgAP*)allocate(cap, AP_sizeW(n_payload));
+ StgAP *ap = (StgAP*)allocate(cap, AP_sizeW(n_payload));
SpW(-1) = (W_)ap;
ap->n_args = n_payload;
+ ap->arity = 0;
// No write barrier is needed here as this is a new allocation
// visible only from our stack
SET_HDR(ap, &stg_AP_NOUPD_info, cap->r.rCCCS)