compiler: disallow runtime.Notify
in Verify
function
Only direct invocations are considered. The check can be disabled with '--no-events' compiler option.
This commit is contained in:
parent
ebff8be20a
commit
1578904da2
4 changed files with 53 additions and 2 deletions
|
@ -337,6 +337,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