sandwich: fixed implicit ref to temp copy

Exposed by test "simple" with -O2