Skip to content

Commit c64277d

Browse files
committed
[ELF] Speculatively fix older MSVC after &ctx change
https://lab.llvm.org/buildbot/#/builders/107/builds/3155 ``` error C2039: 'ctx': is not a member of '`anonymous-namespace'::Writer<ELFT>::fixSectionAlignments::<lambda_38c4af40b02773e966aeff2e6bd45bf2>' ```
1 parent dc2deb5 commit c64277d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lld/ELF/Writer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,7 +2387,7 @@ void Writer<ELFT>::addPhdrForSection(Partition &part, unsigned shType,
23872387
// such section.
23882388
template <class ELFT> void Writer<ELFT>::fixSectionAlignments() {
23892389
const PhdrEntry *prev;
2390-
auto pageAlign = [&](const PhdrEntry *p) {
2390+
auto pageAlign = [&, &ctx = this->ctx](const PhdrEntry *p) {
23912391
OutputSection *cmd = p->firstSec;
23922392
if (!cmd)
23932393
return;
@@ -2427,13 +2427,13 @@ template <class ELFT> void Writer<ELFT>::fixSectionAlignments() {
24272427
// bug, musl (TLS Variant 1 architectures) before 1.1.23 handled TLS
24282428
// blocks correctly. We need to keep the workaround for a while.
24292429
else if (ctx.tlsPhdr && ctx.tlsPhdr->firstSec == p->firstSec)
2430-
cmd->addrExpr = [&ctx = this->ctx] {
2430+
cmd->addrExpr = [&ctx] {
24312431
return alignToPowerOf2(ctx.script->getDot(), ctx.arg.maxPageSize) +
24322432
alignToPowerOf2(ctx.script->getDot() % ctx.arg.maxPageSize,
24332433
ctx.tlsPhdr->p_align);
24342434
};
24352435
else
2436-
cmd->addrExpr = [&ctx = this->ctx] {
2436+
cmd->addrExpr = [&ctx] {
24372437
return alignToPowerOf2(ctx.script->getDot(), ctx.arg.maxPageSize) +
24382438
ctx.script->getDot() % ctx.arg.maxPageSize;
24392439
};

0 commit comments

Comments
 (0)