Skip to content

Commit

Permalink
[FIX] Smali parser ignores goto label inserted into array statement
Browse files Browse the repository at this point in the history
  • Loading branch information
FrenchYeti committed Apr 2, 2021
1 parent 132d55e commit b9d5f25
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/SmaliParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,30 @@ class SmaliParser
this.__tmp_block.setAsConditionalBlock(sml[0].split('_')[1]);

}else if(sml[0].indexOf(':goto_')>-1){
if(this.__tmp_block instanceof CLASS.DataBlock || this.__tmp_block.stack.length>0){
if(this.__tmp_block instanceof CLASS.DataBlock){
if(this.__tmp_block.width!=null){
this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
this.__tmp_block = new CLASS.BasicBlock();
this.__tmp_block.setAsGotoBlock(sml[0].split('_')[1]);
}else{
// ignore this case : invalid smali :
/*
:array_XX
:goto_BB <--- invalid
.array-data A
*/
}
}
else if(this.__tmp_block.stack.length>0){
this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
this.__tmp_block = new CLASS.BasicBlock();
this.__tmp_block.setAsGotoBlock(sml[0].split('_')[1]);
}
else{

this.__tmp_block.setAsGotoBlock(sml[0].split('_')[1]);
}
//this.__tmp_block.tag = sml[0];
this.__tmp_block.setAsGotoBlock(sml[0].split('_')[1]);

}
else if(sml[0].indexOf(':try_start')>-1){
Expand Down

0 comments on commit b9d5f25

Please sign in to comment.