Skip to content

Commit 03ac4ad

Browse files
authored
Merge pull request #5761 from cloudflare/arobinson/use-after-mv
Fix use-after-move in runAlarm exception logging
2 parents 60dad71 + 6b0f0ff commit 03ac4ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/workerd/api/global-scope.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ kj::Promise<WorkerInterface::AlarmResult> ServiceWorkerGlobalScope::runAlarm(kj:
497497

498498
context.getMetrics().reportFailure(e);
499499

500-
auto description = e.getDescription();
500+
auto description = kj::str(e.getDescription()); // because e is moved before this is used
501501
auto log = !jsg::isTunneledException(description) && !jsg::isDoNotLogException(description);
502502
auto isUserError = e.getDetail(jsg::EXCEPTION_IS_USER_ERROR) != kj::none;
503503

0 commit comments

Comments
 (0)