File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
src/hyperlight_host/src/sandbox/trace Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,22 @@ impl MemTraceInfo {
155155 let amt = regs. rax ;
156156 let ptr = regs. rcx ;
157157
158- self . record_trace_frame ( self . epoch , trace_identifier as u64 , |f| {
159- let _ = f. write_all ( & ptr. to_ne_bytes ( ) ) ;
160- let _ = f. write_all ( & amt. to_ne_bytes ( ) ) ;
161- self . write_stack ( f, & stack) ;
162- } )
158+ match trace_identifier {
159+ TraceFrameType :: MemAlloc => {
160+ self . record_trace_frame ( self . epoch , trace_identifier as u64 , |f| {
161+ let _ = f. write_all ( & ptr. to_ne_bytes ( ) ) ;
162+ let _ = f. write_all ( & amt. to_ne_bytes ( ) ) ;
163+ self . write_stack ( f, & stack) ;
164+ } )
165+ }
166+ // The MemFree case does not expect an amount, only a pointer
167+ TraceFrameType :: MemFree => {
168+ self . record_trace_frame ( self . epoch , trace_identifier as u64 , |f| {
169+ let _ = f. write_all ( & ptr. to_ne_bytes ( ) ) ;
170+ self . write_stack ( f, & stack) ;
171+ } )
172+ }
173+ }
163174 }
164175
165176 #[ inline( always) ]
You can’t perform that action at this time.
0 commit comments