Looks some GO compiler bug. Please see below for more details to validate and confirm about bug.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

21 líneas
565B

  1. #!/bin/bash
  2. unset GOPATH
  3. #run plugin directly to see correct result
  4. go run plugin/plugin.go
  5. #compile as plugin
  6. go build -buildmode=plugin -o /tmp/plugin.so ../compiler_bug/plugin/
  7. #running plugin will trigger error
  8. go run runplugin/main.go
  9. #However, if the plugin is compiled with generic tag (To disable asm code, the bug doesn't occur), Some register corruption occurs due to wrong code being generated.
  10. #go build -buildmode=plugin -tags generic -o /tmp/plugin.so ../compiler_bug/plugin/
  11. #running plugin will not cause an error
  12. #go run runplugin/main.go