File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed
src/hyperlight_guest_bin/src Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ static PANIC_BUF: Mutex<String<512>> = Mutex::new(String::new());
149149#[ inline( always) ]
150150fn _panic_handler ( info : & core:: panic:: PanicInfo ) -> ! {
151151 let mut panic_buf_guard = PANIC_BUF . lock ( ) ;
152- let write_res = write ! ( panic_buf_guard, "{}" , info) ;
152+ let write_res = write ! ( panic_buf_guard, "{}\0 " , info) ;
153153 if write_res. is_err ( ) {
154154 unsafe {
155155 abort_with_code_and_message (
@@ -159,16 +159,6 @@ fn _panic_handler(info: &core::panic::PanicInfo) -> ! {
159159 }
160160 }
161161
162- let append_res = panic_buf_guard. push ( '\0' ) ;
163- if append_res. is_err ( ) {
164- unsafe {
165- abort_with_code_and_message (
166- & [ ErrorCode :: UnknownError as u8 ] ,
167- c"panic: message too long" . as_ptr ( ) ,
168- )
169- }
170- }
171-
172162 let c_str_res = CStr :: from_bytes_with_nul ( panic_buf_guard. as_bytes ( ) ) ;
173163 if c_str_res. is_err ( ) {
174164 unsafe {
You can’t perform that action at this time.
0 commit comments