forked from TrueCloudLab/neoneo-go
core: adjust System.Runtime.Notify interop
Part of #1198. Notification name should be UTF8-encoded.
This commit is contained in:
parent
2c41b7b254
commit
120eff92f7
1 changed files with 3 additions and 0 deletions
|
@ -253,6 +253,9 @@ func runtimeNotify(ic *interop.Context, v *vm.VM) error {
|
||||||
if len(name) > MaxEventNameLen {
|
if len(name) > MaxEventNameLen {
|
||||||
return fmt.Errorf("event name must be less than %d", MaxEventNameLen)
|
return fmt.Errorf("event name must be less than %d", MaxEventNameLen)
|
||||||
}
|
}
|
||||||
|
if !utf8.Valid(name) {
|
||||||
|
return errors.New("event name should be UTF8-encoded")
|
||||||
|
}
|
||||||
elem := v.Estack().Pop()
|
elem := v.Estack().Pop()
|
||||||
args := elem.Array()
|
args := elem.Array()
|
||||||
// But it has to be serializable, otherwise we either have some broken
|
// But it has to be serializable, otherwise we either have some broken
|
||||||
|
|
Loading…
Reference in a new issue