CodeQL library for C/C++
codeql/cpp-all 2.1.2-dev (changelog, source)
Search

Class MemoryLocation

A memory location accessed by a memory operand or memory result. In this implementation, the location is one of the following:

  • VariableMemoryLocation - A location within a known IRVariable, at an offset that is either a constant or is unknown.
  • UnknownMemoryLocation - A location not known to be within a specific IRVariable.

Compared to MemoryLocation0, this class does not contain memory locations that represent uses of busy definitions.

Import path

import semmle.code.cpp.ir.implementation.aliased_ssa.internal.AliasedSSA

Direct supertypes

Indirect supertypes

Inherited predicates

canDefineReadOnly

Holds if a definition of this location can be the definition of a read-only use location.

from MemoryLocation0
canReuseSsafrom MemoryLocation0
getAnAllocation

Gets an allocation associated with this MemoryLocation.

from MemoryLocation0
getIRFunctionfrom MemoryLocation0
getIRTypefrom MemoryLocation0
getLocationfrom MemoryLocation0
getTypefrom MemoryLocation0
getUniqueIdfrom MemoryLocation0
getVirtualVariablefrom MemoryLocation0
isAlwaysAllocatedOnStack

Holds if the location always represents memory allocated on the stack (for example, a variable with automatic storage duration).

from MemoryLocation0
isMayAccessfrom MemoryLocation0
isReadOnly

Holds if the location cannot be overwritten except by definition of a MemoryLocation for which def.canDefineReadOnly() holds.

from MemoryLocation0
toStringfrom MemoryLocation0
toStringInternalfrom MemoryLocation0

Charpred