Merge pull request #1995 from nspcc-dev/compiler-verify-notify
compiler: disallow `runtime.Notify` in `Verify` function
This commit is contained in:
commit
efb814a97e
4 changed files with 53 additions and 2 deletions
|
@ -353,6 +353,12 @@ func isInitFunc(decl *ast.FuncDecl) bool {
|
|||
decl.Type.Results.NumFields() == 0
|
||||
}
|
||||
|
||||
func (c *codegen) isVerifyFunc(decl *ast.FuncDecl) bool {
|
||||
return decl.Name.Name == "Verify" && decl.Recv == nil &&
|
||||
decl.Type.Results.NumFields() == 1 &&
|
||||
isBool(c.typeOf(decl.Type.Results.List[0].Type))
|
||||
}
|
||||
|
||||
func (c *codegen) clearSlots(n int) {
|
||||
for i := 0; i < n; i++ {
|
||||
emit.Opcodes(c.prog.BinWriter, opcode.PUSHNULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue