--- title: Final implicit errors tags: decompiler --- 8 more in the paper. 24 + 2,251 ![](https://i.imgur.com/cOfRvu8.png) ## From u6 and d3: #### 1. P11: Incorrectly adds `elif`: Implicit Error Pattern: ```python if c1: s1 elif c2: s2 ``` Correct Pattern: ```python if c1: s1 if c2: s2 ``` #### 2. P12: `and` converted to nested `if`: Implicit Error Pattern: ```python if c1: if c2: s1 elif c3: s2 ``` Correct Pattern: ```python if c1 and c2: s1 elif c3: s2 ``` #### 3. P13: Incorrectly adds `else` after `raise` Implicit Error Pattern: ```python if c1: s1 raise x else: s2 ``` Correct Pattern: ```python if c1: s1 raise x s2 ``` #### 4. P14: Incorrect indentation after `return` Implicit Error Pattern: ```python if c1: s1 return s2 s3 ``` Correct Pattern: ```python if c1: s1 return s2 s3 ``` #### 5. P15: Loop condition moved Implicit Error Pattern: ```python while c1: s1 or c2 ``` Correct Pattern: ```python while c1 and not c2: s1 ``` #### 6. P16: Incorrectly add `else` inside `with` Implicit Error Pattern: ```python with x: if c1: s1 else: s2 ``` Correct Pattern: ```python with x: if c1: s1 s2 ``` #### 7. P17: Converts `while` to `if` with `False` Implicit Error Pattern: ```python if False: s1 ``` Correct Pattern: ```python while False: s1 ``` #### 8. P18: Incorrectly introduced `else` Implicit Error Pattern: ```python if c1: s1 else: s2 ``` Correct Pattern: ```python if c1: s1 s2 ``` ## From other decompilers: #### 1. P19: Duplicated `raise` outside `if` Implicit Error Pattern: ```python if c1: raise s1 return s2 raise s1 ``` Correct Pattern: ```python if c1: raise s1: return s2: ``` #### 2. P20: Incorrect `or` statement Implicit Error Pattern: ```python if not c1: pass s1 = c2 ``` Correct Pattern: ```python s1 = c1 or c2 ``` #### 3. P21: Incorrect `import` statement Implicit Error Pattern: ```python x = x import y ``` Correct Pattern: ```python from x import y ```