Skip to content

Commit 5d61e1d

Browse files
committed
byval implies nocapture
1 parent 24263f8 commit 5d61e1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ir/attrs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ StateValue ParamAttrs::encode(State &s, StateValue &&val, const Type &ty,
431431
if (ty.isPtrType()) {
432432
val.non_poison &=
433433
encodePtrAttrs(s, val.value, getDerefBytes(), derefOrNullBytes, align,
434-
has(NonNull), has(NoCapture), has(Writable), {}, nullptr,
435-
isdecl, false);
434+
has(NonNull), has(NoCapture) | has(ByVal), has(Writable),
435+
{}, nullptr, isdecl, false);
436436

437437
if (!initializes.empty()) {
438438
Pointer p(s.getMemory(), val.value);

0 commit comments

Comments
 (0)