Demur Rumed added the comment:

There is no strict aliasing issues because aliasing is explicitly allowed for 
char buffers. The only issue is unaligned memory reads, but allocations are 
well aligned, so there'd have to be explicit work to allocate & then put code 
at an uneven offset. CPython never does this. This leaves the only issue being 
if a jump has an uneven jump offset. But jumping into the middle of an 
instruction is already undefined behavior because if I jump into a byte that 
happens to be BINARY_ADD on an empty stack it's undefined behavior. Jumping 
into the middle of an instruction thus falls under "Undefined behavior due to 
invalid bytecode"

tl;dr There is no undefined behavior given correct bytecode layout, & we 
already have undefined behavior given incorrect bytecode layout. PREDICT 
concerns may be valid; the solution there may be to have a PEEKOPARG which we 
can then check the short value before splitting it if the opcode portion matches

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27097>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to