Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] JadxRuntimeException: Failed to find switch 'out' block #2248

Open
pubiqq opened this issue Aug 13, 2024 · 0 comments
Open

[core] JadxRuntimeException: Failed to find switch 'out' block #2248

pubiqq opened this issue Aug 13, 2024 · 0 comments
Labels
bug Core Issues in jadx-core module

Comments

@pubiqq
Copy link
Contributor

pubiqq commented Aug 13, 2024

Relevant log output or stacktrace

jadx.core.utils.exceptions.JadxRuntimeException: Failed to find switch 'out' block (already processed)
    at jadx.core.dex.visitors.regions.RegionMaker.calcSwitchOut(RegionMaker.java:928)
    at jadx.core.dex.visitors.regions.RegionMaker.processSwitch(RegionMaker.java:798)
    at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:157)
    at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:91)
    at jadx.core.dex.visitors.regions.RegionMaker.makeEndlessLoop(RegionMaker.java:411)
    at jadx.core.dex.visitors.regions.RegionMaker.processLoop(RegionMaker.java:201)
    at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:135)
    at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:91)
    at jadx.core.dex.visitors.regions.RegionMaker.processFallThroughCases(RegionMaker.java:842)
    at jadx.core.dex.visitors.regions.RegionMaker.processSwitch(RegionMaker.java:801)
    at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:157)
    at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:91)
    at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:52)

Provide sample and class/method full name

Smali

.method public parseFloat()F
    .registers 13

    .line 1599
    const/4 v0, 0x0

    .line 1600
    .local v0, "mant":I
    const/4 v1, 0x0

    .line 1601
    .local v1, "mantDig":I
    const/4 v2, 0x1

    .line 1602
    .local v2, "mantPos":Z
    const/4 v3, 0x0

    .line 1604
    .local v3, "mantRead":Z
    const/4 v4, 0x0

    .line 1605
    .local v4, "exp":I
    const/4 v5, 0x0

    .line 1606
    .local v5, "expDig":I
    const/4 v6, 0x0

    .line 1607
    .local v6, "expAdj":I
    const/4 v7, 0x1

    .line 1609
    .local v7, "expPos":Z
    iget-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    packed-switch v8, :pswitch_data_e2

    :pswitch_d
    goto :goto_15

    .line 1611
    :pswitch_e
    const/4 v2, 0x0

    .line 1614
    :pswitch_f
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1618
    :goto_15
    iget-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    const/16 v9, 0x9

    const/4 v10, 0x0

    packed-switch v8, :pswitch_data_ec

    .line 1620
    :pswitch_1d
    const/high16 v8, 0x7fc00000    # Float.NaN

    return v8

    .line 1626
    :pswitch_20
    const/4 v3, 0x1

    .line 1629
    :goto_21
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1630
    sparse-switch v8, :sswitch_data_108

    .line 1646
    return v10

    .line 1640
    :sswitch_2b
    nop

    .line 1660
    :pswitch_2c
    const/4 v3, 0x1

    .line 1663
    :goto_2d
    if-ge v1, v9, :cond_3a

    .line 1664
    add-int/lit8 v1, v1, 0x1

    .line 1665
    mul-int/lit8 v8, v0, 0xa

    iget-char v11, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    add-int/lit8 v11, v11, -0x30

    add-int/2addr v8, v11

    move v0, v8

    .end local v0    # "mant":I
    .local v8, "mant":I
    goto :goto_3c

    .line 1667
    .end local v8    # "mant":I
    .restart local v0    # "mant":I
    :cond_3a
    add-int/lit8 v6, v6, 0x1

    .line 1669
    :goto_3c
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1670
    packed-switch v8, :pswitch_data_13e

    .line 1672
    goto :goto_4a

    :pswitch_46
    goto :goto_2d

    .line 1646
    :sswitch_47
    goto :goto_21

    .line 1644
    :sswitch_48
    goto :goto_4a

    .line 1623
    :pswitch_49
    nop

    .line 1687
    :goto_4a
    iget-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    const/16 v11, 0x2e

    if-ne v8, v11, :cond_8a

    .line 1688
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1690
    packed-switch v8, :pswitch_data_156

    .line 1694
    if-nez v3, :cond_8a

    .line 1695
    invoke-direct {p0, v8}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->reportUnexpectedCharacterError(C)V

    .line 1696
    return v10

    .line 1701
    :pswitch_5f
    if-nez v1, :cond_71

    .line 1704
    :goto_61
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1705
    add-int/lit8 v6, v6, -0x1

    .line 1706
    packed-switch v8, :pswitch_data_16e

    .line 1718
    if-nez v3, :cond_8a

    .line 1719
    return v10

    .line 1716
    :pswitch_6f
    goto :goto_71

    .line 1719
    :pswitch_70
    goto :goto_61

    .line 1737
    :cond_71
    :goto_71
    :pswitch_71
    if-ge v1, v9, :cond_7f

    .line 1738
    add-int/lit8 v1, v1, 0x1

    .line 1739
    mul-int/lit8 v8, v0, 0xa

    iget-char v11, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    add-int/lit8 v11, v11, -0x30

    add-int/2addr v8, v11

    .line 1740
    .end local v0    # "mant":I
    .restart local v8    # "mant":I
    add-int/lit8 v6, v6, -0x1

    move v0, v8

    .line 1742
    .end local v8    # "mant":I
    .restart local v0    # "mant":I
    :cond_7f
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1743
    packed-switch v8, :pswitch_data_186

    .line 1745
    goto :goto_8a

    :pswitch_89
    goto :goto_71

    .line 1761
    :cond_8a
    :goto_8a
    iget-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    sparse-switch v8, :sswitch_data_19e

    goto :goto_d5

    .line 1764
    :sswitch_90
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1765
    packed-switch v8, :pswitch_data_1a8

    .line 1767
    :pswitch_99
    invoke-direct {p0, v8}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->reportUnexpectedCharacterError(C)V

    .line 1768
    return v10

    .line 1770
    :pswitch_9d
    const/4 v7, 0x0

    .line 1772
    :pswitch_9e
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1773
    packed-switch v8, :pswitch_data_1ca

    .line 1775
    invoke-direct {p0, v8}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->reportUnexpectedCharacterError(C)V

    .line 1776
    return v10

    .line 1801
    :pswitch_ab
    iget-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    packed-switch v8, :pswitch_data_1e2

    goto :goto_d5

    .line 1805
    :goto_b1
    :pswitch_b1
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1806
    packed-switch v8, :pswitch_data_1fa

    .line 1818
    goto :goto_d5

    .line 1816
    :pswitch_bb
    nop

    .line 1834
    :goto_bc
    :pswitch_bc
    const/4 v8, 0x3

    if-ge v5, v8, :cond_c9

    .line 1835
    add-int/lit8 v5, v5, 0x1

    .line 1836
    mul-int/lit8 v8, v4, 0xa

    iget-char v9, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    add-int/lit8 v9, v9, -0x30

    add-int/2addr v8, v9

    move v4, v8

    .line 1838
    :cond_c9
    invoke-direct {p0}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->read()C

    move-result v8

    iput-char v8, p0, Lorg/telegram/messenger/SvgHelper$ParserHelper;->current:C

    .line 1839
    packed-switch v8, :pswitch_data_212

    .line 1841
    goto :goto_d5

    :pswitch_d3
    goto :goto_bc

    .line 1818
    :pswitch_d4
    goto :goto_b1

    .line 1858
    :goto_d5
    if-nez v7, :cond_d8

    .line 1859
    neg-int v4, v4

    .line 1861
    :cond_d8
    add-int/2addr v4, v6

    .line 1862
    if-nez v2, :cond_dc

    .line 1863
    neg-int v0, v0

    .line 1866
    :cond_dc
    invoke-virtual {p0, v0, v4}, Lorg/telegram/messenger/SvgHelper$ParserHelper;->buildFloat(II)F

    move-result v8

    return v8

    nop

    :pswitch_data_e2
    .packed-switch 0x2b
        :pswitch_f
        :pswitch_d
        :pswitch_e
    .end packed-switch

    :pswitch_data_ec
    .packed-switch 0x2e
        :pswitch_49
        :pswitch_1d
        :pswitch_20
        :pswitch_2c
        :pswitch_2c
        :pswitch_2c
        :pswitch_2c
        :pswitch_2c
        :pswitch_2c
        :pswitch_2c
        :pswitch_2c
        :pswitch_2c
    .end packed-switch

    :sswitch_data_108
    .sparse-switch
        0x2e -> :sswitch_48
        0x30 -> :sswitch_47
        0x31 -> :sswitch_2b
        0x32 -> :sswitch_2b
        0x33 -> :sswitch_2b
        0x34 -> :sswitch_2b
        0x35 -> :sswitch_2b
        0x36 -> :sswitch_2b
        0x37 -> :sswitch_2b
        0x38 -> :sswitch_2b
        0x39 -> :sswitch_2b
        0x45 -> :sswitch_48
        0x65 -> :sswitch_48
    .end sparse-switch

    :pswitch_data_13e
    .packed-switch 0x30
        :pswitch_46
        :pswitch_46
        :pswitch_46
        :pswitch_46
        :pswitch_46
        :pswitch_46
        :pswitch_46
        :pswitch_46
        :pswitch_46
        :pswitch_46
    .end packed-switch

    :pswitch_data_156
    .packed-switch 0x30
        :pswitch_5f
        :pswitch_71
        :pswitch_71
        :pswitch_71
        :pswitch_71
        :pswitch_71
        :pswitch_71
        :pswitch_71
        :pswitch_71
        :pswitch_71
    .end packed-switch

    :pswitch_data_16e
    .packed-switch 0x30
        :pswitch_70
        :pswitch_6f
        :pswitch_6f
        :pswitch_6f
        :pswitch_6f
        :pswitch_6f
        :pswitch_6f
        :pswitch_6f
        :pswitch_6f
        :pswitch_6f
    .end packed-switch

    :pswitch_data_186
    .packed-switch 0x30
        :pswitch_89
        :pswitch_89
        :pswitch_89
        :pswitch_89
        :pswitch_89
        :pswitch_89
        :pswitch_89
        :pswitch_89
        :pswitch_89
        :pswitch_89
    .end packed-switch

    :sswitch_data_19e
    .sparse-switch
        0x45 -> :sswitch_90
        0x65 -> :sswitch_90
    .end sparse-switch

    :pswitch_data_1a8
    .packed-switch 0x2b
        :pswitch_9e
        :pswitch_99
        :pswitch_9d
        :pswitch_99
        :pswitch_99
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
    .end packed-switch

    :pswitch_data_1ca
    .packed-switch 0x30
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
        :pswitch_ab
    .end packed-switch

    :pswitch_data_1e2
    .packed-switch 0x30
        :pswitch_b1
        :pswitch_bc
        :pswitch_bc
        :pswitch_bc
        :pswitch_bc
        :pswitch_bc
        :pswitch_bc
        :pswitch_bc
        :pswitch_bc
        :pswitch_bc
    .end packed-switch

    :pswitch_data_1fa
    .packed-switch 0x30
        :pswitch_d4
        :pswitch_bb
        :pswitch_bb
        :pswitch_bb
        :pswitch_bb
        :pswitch_bb
        :pswitch_bb
        :pswitch_bb
        :pswitch_bb
        :pswitch_bb
    .end packed-switch

    :pswitch_data_212
    .packed-switch 0x30
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
        :pswitch_d3
    .end packed-switch
.end method

Jadx version

1.5.0

Related

#2246, #2054, #826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

1 participant