mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-03 03:08:12 +08:00
Keep the monitor's whole-extent capture off the record stack
This commit is contained in:
@@ -205,7 +205,6 @@ impl Fsm for FillToolFsmState {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test_fill {
|
mod test_fill {
|
||||||
pub use crate::test_utils::test_prelude::*;
|
pub use crate::test_utils::test_prelude::*;
|
||||||
use graphene_std::Graphic;
|
|
||||||
use graphene_std::color::SRGBA8;
|
use graphene_std::color::SRGBA8;
|
||||||
use graphene_std::vector::fill;
|
use graphene_std::vector::fill;
|
||||||
|
|
||||||
|
|||||||
@@ -194,6 +194,9 @@ fn monitor<'e>(
|
|||||||
if ctx.innermost_index() == 0
|
if ctx.innermost_index() == 0
|
||||||
&& let GPoll::Final(value) | GPoll::Partial(value) = &result
|
&& let GPoll::Final(value) | GPoll::Partial(value) = &result
|
||||||
{
|
{
|
||||||
|
// The materialization below evaluates the level again; its frames sit
|
||||||
|
// above the one this eval already claimed and must not survive.
|
||||||
|
let mark = core_types::record::stack::sp();
|
||||||
let captured = match content.layout().depth {
|
let captured = match content.layout().depth {
|
||||||
// SAFETY: the value came from this edge, so it carries the edge's layout.
|
// SAFETY: the value came from this edge, so it carries the edge's layout.
|
||||||
0 => unsafe { RecordCapture::capture(content.layout(), content.layout().rec(value), ctx.arena()) },
|
0 => unsafe { RecordCapture::capture(content.layout(), content.layout().rec(value), ctx.arena()) },
|
||||||
@@ -205,6 +208,9 @@ fn monitor<'e>(
|
|||||||
LevelStatus::Pending | LevelStatus::Error(_) => None,
|
LevelStatus::Pending | LevelStatus::Error(_) => None,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
// SAFETY: the capture copies into the arena, so nothing borrows the
|
||||||
|
// frames left above the mark.
|
||||||
|
unsafe { core_types::record::stack::rewind(mark) };
|
||||||
*io.lock().unwrap() = captured.map(|output| IORecord {
|
*io.lock().unwrap() = captured.map(|output| IORecord {
|
||||||
input: CtxSnapshot::capture(ctx),
|
input: CtxSnapshot::capture(ctx),
|
||||||
output,
|
output,
|
||||||
|
|||||||
Reference in New Issue
Block a user