[PATCH] Add zeroed env pointer when a const fn is passed as an argument.
[Thread Prev] | [Thread Next]
- Subject: [PATCH] Add zeroed env pointer when a const fn is passed as an argument.
- From: iriri <iri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: myrddin-dev@xxxxxxxxxxxxxx
- Date: Sun, 22 Jul 2018 01:17:49 -0700
- To: "myrddin-dev" <myrddin-dev@xxxxxxxxxxxxxx>
This makes it safe to fndup a global function which makes it safe to spawn a global function. --- 6/simp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/6/simp.c b/6/simp.c index 812218ca..8bb0d886 100644 --- a/6/simp.c +++ b/6/simp.c @@ -298,7 +298,7 @@ slicelen(Simp *s, Node *sl) Node * loadvar(Simp *s, Node *n, Node *dst) { - Node *p, *f, *r; + Node *p, *f, *r, *e; if (isconstfn(n)) { if (dst) @@ -308,6 +308,9 @@ loadvar(Simp *s, Node *n, Node *dst) f = getcode(s, n); p = addr(s, r, exprtype(n)); assignat(s, p, Ptrsz, f); + e = mkintlit(n->loc, 0); + e->expr.type = tyintptr; + assignat(s, p, 0, e); } else { r = n; } -- 2.18.0
Re: [PATCH] Add zeroed env pointer when a const fn is passed as an argument. | Ori Bernstein <ori@xxxxxxxxxxxxxx> |
- Prev by Date: Re: [PATCH] Support direct tuple access operators "tuple.N"
- Next by Date: Re: [PATCH] Add zeroed env pointer when a const fn is passed as an argument.
- Previous by thread: [PATCH] Add documentation for tuple access expressions
- Next by thread: Re: [PATCH] Add zeroed env pointer when a const fn is passed as an argument.
- Index(es):