mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
checker: improve checking of a << b, when a and b are numbers (#12589)
This commit is contained in:
parent
fe37da31a8
commit
6d97b0a407
33 changed files with 436 additions and 148 deletions
|
@ -177,7 +177,7 @@ pub fn (mut ws Client) listen() ? {
|
|||
ws.close(1002, 'close payload cannot be 1 byte') ?
|
||||
return error('close payload cannot be 1 byte')
|
||||
}
|
||||
code := (int(msg.payload[0]) << 8) + int(msg.payload[1])
|
||||
code := u16(msg.payload[0]) << 8 | u16(msg.payload[1])
|
||||
if code in invalid_close_codes {
|
||||
ws.close(1002, 'invalid close code: $code') ?
|
||||
return error('invalid close code: $code')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue