Patent ID: 7856624

Claim:
A software development method for use in a software development system comprising a combination of hardware and software including a storage device and a compiler, said method comprising: said compiler receiving, from said storage device, at least one C or C++ input source file embodying the features defined in the full ISO C90 standard and/or the full ISO C99 standard and/or the full ISO C++ standard; and said compiler compiling said input source file into an executable object file, wherein said compiling automatically identifies and/or eliminates substantially all undefined behaviors of said input source file, and wherein said compiling includes generating object code which is free from predetermined designated sets of undefined behaviors including buffer overflow and null pointer indirection, and incorporating at least three methods used in producing said object code, selected from the following group: (a) in _Sat logic where a subscript or pointer N does not exceed a Hi value, a generated assembler code uses assembler conditional instructions including any one or more of Load N, Cmp Hi, an Load Hi if Greater; (b) when a processor supports only a _Sat logic that saturates at a UINT_MAX value (P), the generated assembler saturates at an arbitrary Bound using an “Add-Sat” instruction (add with saturation at P) including any one or more of Load N, Add-Sat (P-Bound), Subtract (P-Bound); (c) when a Bound is a power of two, then a _Modwrap logic is provided by a bitwise-and including an option to be evaluated in code optimization of allocating extra elements in an array to make its actual Bound be a next higher power of two; (d) when the Bound is 255 or 65,535, the generated assembler code maintains a subscript value N as a one-byte or two-byte value within a larger value, using one-byte or two-byte instructions, which will act as if every store of N were bitwise-anded with 0xFF or 0xFFFF before each store; and (e) implementing _Zerobound logic using conditional assembler instructions including any one or more of Load P into reg A, Cmp Bound (producing a zero or nonzero value in reg B), Load if B is nonzero *A into B (leaving the zero result of comparison as the result value of the _Zerobound logic).