File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,8 @@ impl Arch for ArchArm {
320320 let opcode = string_fmt. into_string ( ) ;
321321 cb ( InstructionPart :: opcode ( opcode, resolved. ins_ref . opcode ) ) ?;
322322
323- let mut args_formatter = ArgsFormatter { options : & options, cb, resolved : & resolved } ;
323+ let mut args_formatter =
324+ ArgsFormatter { options : & options, cb, resolved : & resolved, skip_leading_space : true } ;
324325 ins. write_params ( & mut args_formatter) ?;
325326 Ok ( ( ) )
326327 }
@@ -473,6 +474,7 @@ pub struct ArgsFormatter<'a> {
473474 options : & ' a unarm:: Options ,
474475 cb : & ' a mut dyn FnMut ( InstructionPart ) -> Result < ( ) > ,
475476 resolved : & ' a ResolvedInstructionRef < ' a > ,
477+ skip_leading_space : bool ,
476478}
477479
478480impl ArgsFormatter < ' _ > {
@@ -504,6 +506,15 @@ impl unarm::FormatIns for ArgsFormatter<'_> {
504506 ins. write_params ( self )
505507 }
506508
509+ fn write_space ( & mut self ) -> core:: fmt:: Result {
510+ if self . skip_leading_space {
511+ self . skip_leading_space = false ;
512+ Ok ( ( ) )
513+ } else {
514+ self . write_str ( " " )
515+ }
516+ }
517+
507518 fn write_separator ( & mut self ) -> core:: fmt:: Result { self . write ( InstructionPart :: separator ( ) ) }
508519
509520 fn write_uimm ( & mut self , uimm : u32 ) -> core:: fmt:: Result {
You can’t perform that action at this time.
0 commit comments