Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions analyzer/opcode/opcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ func (op *opcode) Analyze(path string, withTrace bool) ([]*analyzer.Issue, error
if err != nil { // non-reachable portion ignored
continue
}
if !withTrace {
source.CallStack = nil
}

issue := &analyzer.Issue{
Severity: analyzer.IssueSeverityCritical,
CallStack: source,
Expand All @@ -58,6 +54,9 @@ func (op *opcode) Analyze(path string, withTrace bool) ([]*analyzer.Issue, error
if common.ShouldIgnoreSource(source, op.profile.IgnoredFunctions) {
issue.Severity = analyzer.IssueSeverityWarning
}
if !withTrace {
source.CallStack = nil
}
issues = append(issues, issue)
}
}
Expand Down
7 changes: 3 additions & 4 deletions analyzer/syscall/asm_syscall.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ func (a *asmSyscallAnalyser) Analyze(path string, withTrace bool) ([]*analyzer.I
if err != nil { // non-reachable portion ignored
continue
}
if !withTrace {
source.CallStack = nil
}

severity := analyzer.IssueSeverityCritical
if common.ShouldIgnoreSource(source, a.profile.IgnoredFunctions) {
Expand All @@ -80,7 +77,9 @@ func (a *asmSyscallAnalyser) Analyze(path string, withTrace bool) ([]*analyzer.I
message = fmt.Sprintf("Potential NOOP Syscall Detected: %d", syscall.Number)
severity = analyzer.IssueSeverityWarning
}

if !withTrace {
source.CallStack = nil
}
issues = append(issues, &analyzer.Issue{
Severity: severity,
Message: message,
Expand Down
4 changes: 2 additions & 2 deletions common/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ func ProgramEntrypoint(arch string) func(function string) bool {
function == "runtime.schedinit" ||
function == "runtime.newproc" ||
function == "runtime.mstart" ||
function == "main.main" || // main
strings.Contains(function, "main.main") || // main and closures or anonymous functions
strings.Contains(function, ".init.") || // all init functions
strings.HasSuffix(function, ".init") // vars
}
case "mips64":
return func(function string) bool {
return function == "runtime.rt0_go" || // start point of a go program
function == "main.main" || // main
strings.Contains(function, "main.main") || // main and closures or anonymous functions
strings.Contains(function, ".init.") || // all init functions
strings.HasSuffix(function, ".init") // vars
}
Expand Down
Loading