https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65772

--- Comment #2 from boger at us dot ibm.com ---
When running the attached testcase on a platform with gccgo (ppc64le, x86_64),
the test fails due to incorrect return values from the function getList.  The
source line for the return looks like this:

return files, filepath.Walk(dir, visit)

The problem occurs because the array "files" is declared in the getList
function, and updated by the "visit" function which is passed to filepath.Walk.
 The array that is returned from getList does not reflect the updates made by
the visit.

When build with gc for either ppc64le or x86_64, the test case passes.

Expected output:

./myreturn
### Trying to list file: /tmp/mytest465364283/stuff in dir:
/tmp/mytest465364283 ###
### When walking:  found file: /tmp/mytest465364283/stuff ###
### PASS:  files returned !###


Incorrect output:

./myreturn
### Trying to list file: /tmp/mytest819936920/stuff in dir:
/tmp/mytest819936920 ###
### When walking:  found file: /tmp/mytest819936920/stuff ###
### FAIL:  no files returned ###

Reply via email to