Looks some GO compiler bug. Please see below for more details to validate and confirm about bug.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

21 linhas
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