Skip to content

Commit

Permalink
detect and fix incorect format args
Browse files Browse the repository at this point in the history
  • Loading branch information
notaz committed Aug 7, 2017
1 parent 355815e commit 19a2e09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions OpArith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,15 @@ int OpNbcd(int op)
ot(" beq finish%.4x\n",op);
ot("\n");

ot(" mvn r3,r11,lsr #31 ;@ Undefined V behavior\n",op);
ot(" mvn r3,r11,lsr #31 ;@ Undefined V behavior\n");
ot(" and r2,r11,#0x0f000000\n");
ot(" cmp r2,#0x0a000000\n");
ot(" andeq r11,r11,#0xf0000000\n");
ot(" addeq r11,r11,#0x10000000\n");
ot(" and r3,r3,r11,lsr #31 ;@ Undefined V behavior part II\n",op);
ot(" and r3,r3,r11,lsr #31 ;@ Undefined V behavior part II\n");
ot(" movs r1,r11,asr #24\n");
ot(" bicne r10,r10,#0x40000000 ;@ Z\n");
ot(" orr r10,r10,r3,lsl #28 ;@ save V\n",op);
ot(" orr r10,r10,r3,lsl #28 ;@ save V\n");
ot(" orr r10,r10,#0x20000000 ;@ C\n");
ot("\n");

Expand Down
4 changes: 2 additions & 2 deletions OpMove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ int OpMovem(int op)

if (dir)
{
ot(" ;@ Copy memory to register:\n",1<<size);
ot(" ;@ Copy memory to register:\n");
earead_check_addrerr=0; // already checked
EaRead (6,0,ea,size,0x003f);
ot(" str r0,[r7,r4] ;@ Save value into Dn/An\n");
}
else
{
ot(" ;@ Copy register to memory:\n",1<<size);
ot(" ;@ Copy register to memory:\n");
ot(" ldr r1,[r7,r4] ;@ Load value from Dn/An\n");
#if SPLIT_MOVEL_PD
if (decr && size==2) { // -(An)
Expand Down
6 changes: 5 additions & 1 deletion app.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ extern const char * const Sarm[4]; // Sign-extend ARM Extensions for operand siz
extern int Cycles; // Current cycles for opcode
extern int pc_dirty; // something changed PC during processing
extern int arm_op_count; // for stats
void ot(const char *format, ...);
void ot(const char *format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 1, 2)));
#endif
;
void ltorg();
int MemHandler(int type,int size,int addrreg=0,int need_addrerr_check=1);
void FlushPC(int force=0);
Expand Down

0 comments on commit 19a2e09

Please sign in to comment.