Skip to content

Commit

Permalink
Return a copy of args
Browse files Browse the repository at this point in the history
  • Loading branch information
obs-gh-patrickscott committed Apr 11, 2023
1 parent 097c7f9 commit bfa415d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/tools/builders/asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func buildSymabisFile(goenv *env, sFiles, hFiles []fileInfo, asmhdr string) (str
seenHdrDirs[hdrDir] = true
}
}
asmDefines(asmargs)
asmargs = asmDefines(asmargs)
asmargs = append(asmargs, "-gensymabis", "-o", symabisName, "--")
for _, sFile := range sFiles {
asmargs = append(asmargs, sFile.filename)
Expand All @@ -106,16 +106,16 @@ func asmFile(goenv *env, srcPath, packagePath string, asmFlags []string, outPath
if packagePath != "" && isGo119OrHigher() {
args = append(args, "-p", packagePath)
}
asmDefines(args)
args = asmDefines(args)
args = append(args, "-trimpath", ".")
args = append(args, "-o", outPath)
args = append(args, "--", srcPath)
absArgs(args, []string{"-I", "-o", "-trimpath"})
return goenv.runCommand(args)
}

func asmDefines(args []string) {
args = append(args,
func asmDefines(args []string) []string {
return append(args,
"-D", "GOOS_"+runtime.GOOS,
"-D", "GOARCH_"+runtime.GOARCH,
"-D", "GOOS_GOARCH_"+runtime.GOOS+"_"+runtime.GOARCH,
Expand Down

0 comments on commit bfa415d

Please sign in to comment.