Commit 1e4aeb6
ds2: unbreak network-based non-reverse debugging.
Prior to commit e93f823, the above scenario called
`socket->accept().get()` and passed the returned value to RunDebugServer
causing the lifetime of the temporary returned by `socket->accept()` to
be extended until the end of the RunDebugServer call. Commit e93f823
instead stored the above `.get()`'s returned (raw) pointer in a stack
local, allowing `socket->accept()`'s return value to go out of scope
before the call to `RunDebugServer`, and since it's a std::unique_ptr,
the underlying `Socket` to be freed, making the raw pointer no longer
valid.
This commit ensures the `accept()`ed Socket is held in a
`std::unique_ptr` of its own and outlives the call to `RunDebugServer`.1 parent 06b8da5 commit 1e4aeb6
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
479 | 483 | | |
480 | 484 | | |
481 | 485 | | |
482 | | - | |
| 486 | + | |
483 | 487 | | |
484 | 488 | | |
485 | 489 | | |
| |||
495 | 499 | | |
496 | 500 | | |
497 | 501 | | |
498 | | - | |
| 502 | + | |
499 | 503 | | |
500 | 504 | | |
501 | 505 | | |
| |||
0 commit comments