Abstract

Java programmers have the security of knowing that errors like out-of-bounds array indexes or attempts to dereference a null pointer will be detected and reported at run time. C and C++ programmers count on tools like Purify to achieve a similar level of confidence. The run-time checks provided by Purify have proved to be extremely useful to programmers in debugging their programs.Java also provides security via its strong type system. For example:• There are no union types in Java, so it is not possible for a program to write into a field of one type and then access that value via a field of a different type.• Only very restricted kinds of casting are allowed; for example, it is not possible to treat a pointer as if it were an integer or vice versa.• When an object is down-cast to a subtype, a run-time check will be performed to ensure that the actual type of the object is consistent with the cast.However, tools like Purify do not provide similar checks for C/C++ programs. This research involves the design and implementation of a tool to provide new kinds of run-time checks based on type information. That is, the goal of the tool is to help C/C++ programmers find errors in their programs that manifest themselves as bad run-time types, in the same way that Purify helps programmers find errors in their programs that manifest themselves as bad run-time memory accesses.The basic idea is to associate a run-time type with every piece of data. Whenever data is used by some operation, a check is performed to ensure that its run-time type is consistent with the type expected by the operation. For example, when a pointer is dereferenced, its run-time type must be "pointer" (not "int", "float", "uninitialized", etc). When an integer multiplication is performed, the operands' run-time types must be "int" (not "pointer", "float", "uninitialized", etc).

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.