* ORC: track escaping parameters properly

* fixes #18240
This commit is contained in:
Andreas Rumpf 2021-06-25 14:12:23 +02:00 • committed by GitHub
commit ceb9e3efc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 12 deletions

View file

@ -32,3 +32,35 @@ when true:
waitFor hello(Flags())
echo "success"
# bug #18240
import tables
type
TopicHandler* = proc(topic: string,
data: seq[byte]): Future[void] {.gcsafe, raises: [Defect].}
PeerID* = object
data*: seq[byte]
PeerInfo* = ref object of RootObj
peerId*: PeerID
Connection* = ref object of RootObj
peerInfo*: PeerInfo
PubSubPeer* = ref object of RootObj
codec*: string
PubSub* = ref object of RootObj
topics*: Table[string, seq[TopicHandler]]
peers*: Table[PeerID, PubSubPeer]
proc getOrCreatePeer*(myParam: PubSub, peerId: PeerID, protos: seq[string]): PubSubPeer =
myParam.peers.withValue(peerId, peer):
return peer[]
method handleConn*(myParam: PubSub,
conn: Connection,
proto: string) {.base, async.} =
myParam.peers.withValue(conn.peerInfo.peerId, peer):
let peerB = peer[]