From b5a23d3b3e906ffeeda1413034ab26b937bf440f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix-local[bot]" <61578317+deepsource-autofix-local[bot]@users.noreply.github.com> Date: Thu, 6 May 2021 06:56:40 +0000 Subject: [PATCH] Delete empty fallthrough --- pkg/proc/eval.go | 23 ++++++----------------- pkg/proc/variables.go | 5 ++--- pkg/proc/x86_disasm.go | 3 +-- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/pkg/proc/eval.go b/pkg/proc/eval.go index ab1448541c..ea994dae8a 100644 --- a/pkg/proc/eval.go +++ b/pkg/proc/eval.go @@ -881,21 +881,15 @@ func (scope *EvalScope) evalTypeCast(node *ast.CallExpr) (*Variable, error) { } case *godwarf.FloatType: switch argv.Kind { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - fallthrough - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - fallthrough - case reflect.Float32, reflect.Float64: + + case reflect.Float32, reflect.Float64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: v.Value = argv.Value return v, nil } case *godwarf.ComplexType: switch argv.Kind { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - fallthrough - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - fallthrough - case reflect.Float32, reflect.Float64: + + case reflect.Float32, reflect.Float64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: v.Value = argv.Value return v, nil } @@ -1613,13 +1607,8 @@ func (scope *EvalScope) evalBinary(node *ast.BinaryExpr) (*Variable, error) { // Both xv and yv must be loaded and have a compatible type (as determined by negotiateType) func compareOp(op token.Token, xv *Variable, yv *Variable) (bool, error) { switch xv.Kind { - case reflect.Bool: - fallthrough - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - fallthrough - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - fallthrough - case reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: + + case reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Bool: return constantCompare(op, xv.Value, yv.Value) case reflect.String: if xv.Len != yv.Len { diff --git a/pkg/proc/variables.go b/pkg/proc/variables.go index 3ff8e5f4ef..4b7781720f 100644 --- a/pkg/proc/variables.go +++ b/pkg/proc/variables.go @@ -2219,9 +2219,8 @@ func (v *Variable) ConstDescr() string { } switch v.Kind { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - fallthrough - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: n, _ := constant.Int64Val(v.Value) return ctyp.describe(n) } diff --git a/pkg/proc/x86_disasm.go b/pkg/proc/x86_disasm.go index f2ed572dc5..98acb31d8b 100644 --- a/pkg/proc/x86_disasm.go +++ b/pkg/proc/x86_disasm.go @@ -60,8 +60,7 @@ func (inst *x86Inst) Text(flavour AssemblyFlavour, pc uint64, symLookup func(uin text = x86asm.GNUSyntax(x86asm.Inst(*inst), pc, symLookup) case GoFlavour: text = x86asm.GoSyntax(x86asm.Inst(*inst), pc, symLookup) - case IntelFlavour: - fallthrough + default: text = x86asm.IntelSyntax(x86asm.Inst(*inst), pc, symLookup) }