CodeQL library for Go
codeql/go-all 4.2.5-dev (changelog, source)
Search

Member predicate MaxValueState::getBitSize

Gets the smallest bitsize where the maximum value that could get to this point fits into an integer type whose maximum value is 2^(result) - 1.

For example, if we know 1 << 12 can get to a particular program point, then the result would be 15, since a 16-bit signed integer can represent that value and that type has maximum value 2^15 -1. An unsigned 8-bit integer cannot represent that value as its maximum value is 2^8 - 1.

int getBitSize()