First, you don't know it's illegal. I can't believe that the TSXs electronic trading system would allow a trade after the close. Traders with "direct access" (ie the one's sitting at the bank's trading desks) entering a market order could conceiveably submit a market trade at 3:59:59 and it would go through electronically "AT" the close.
But you are right, it is worth checking on. Are you going to call them in the morning?