...
| Code Block | ||
|---|---|---|
| ||
int *loop_ptr;
int *int_ptr;
int *loopFunction(int *v_pointer) {
return v_pointer;
}
int_ptr = loopFunction(loop_ptr);
|
Implementation Details
The following list shows common alignments for Microsoft, Borland, and GNU compilers for the IA-32 architecture.
Type | Alignment |
|---|---|
| 1 byte aligned |
| 2 byte aligned |
| 4 byte aligned |
| 4 byte aligned |
| 8 byte on Windows, 4 byte on Linux |
Risk Assessment
Accessing a pointer or an object that is no longer on the correct access boundary can cause a program to crash, give wrong information, or may cause slow pointer accesses (if the architecture allows misaligned accesses).
...