Skip to content

Commit 6c90747

Browse files
aykevldeadprogram
authored andcommitted
compiler: crypto/internal/sysrand is allowed to use unsafe signatures
Apparently this package imports `runtime.getRandomData` from the gojs module. This is not yet implemented, but simply allowing this package to do such imports gets crypto/sha256 to compile.
1 parent e496638 commit 6c90747

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/symbol.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
446446
// The list of allowed types is based on this proposal:
447447
// https://github.com/golang/go/issues/59149
448448
func (c *compilerContext) checkWasmImportExport(f *ssa.Function, pragma string) {
449-
if c.pkg.Path() == "runtime" || c.pkg.Path() == "syscall/js" || c.pkg.Path() == "syscall" {
449+
if c.pkg.Path() == "runtime" || c.pkg.Path() == "syscall/js" || c.pkg.Path() == "syscall" || c.pkg.Path() == "crypto/internal/sysrand" {
450450
// The runtime is a special case. Allow all kinds of parameters
451451
// (importantly, including pointers).
452452
return

0 commit comments

Comments
 (0)