array_index_nospec in Linux x86

Linux(tag v5.4)のソースコードリーディングをしていたときに面白いと思ったマクロのメモ. array_index_nospec include/linux/nospec.hで以下のように定義される. /* * array_index_nospec - sanitize an array index after a bounds check * * For a code sequence like: * * if (index < size) { * index = array_inde…