Skip to main content

Taming the Wrapping of Integer Arithmetic

  • Conference paper
Static Analysis (SAS 2007)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4634))

Included in the following conference series:

Abstract

Variables in programs are usually confined to a fixed number of bits and results that require more bits are truncated. Due to the use of 32-bit and 64-bit variables, inadvertent overflows are rare. However, a sound static analysis must reason about overflowing calculations and conversions between unsigned and signed integers; the latter remaining a common source of subtle programming errors. Rather than polluting an analysis with the low-level details of modelling two’s complement wrapping behaviour, this paper presents a computationally light-weight solution based on polyhedral analysis which eliminates the need to check for wrapping when evaluating most (particularly linear) assignments.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
¥17,985 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
JPY 3498
Price includes VAT (Japan)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
JPY 5719
Price includes VAT (Japan)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
JPY 7149
Price includes VAT (Japan)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Bagnara, R., Dobson, K., Hill, P.M., Mundell, M., Zaffanella, E.: Grids: A Domain for Analyzing the Distribution of Numerical values. In: Puebla, G. (ed.) LOPSTR 2006. LNCS, vol. 4407, Springer, Heidelberg (2006)

    Google Scholar 

  2. Bagnara, R., Ricci, E., Zaffanella, E., Hill, P.M.: Possibly Not Closed Convex Polyhedra and the Parma Polyhedra Library. In: Hermenegildo, M.V., Puebla, G. (eds.) SAS 2002. LNCS, vol. 2477, pp. 213–229. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  3. Joint Technical Committee.: International Standard ISO/IEC of C 98/99 (1999)

    Google Scholar 

  4. Cousot, P., Cousot, R.: Comparing the Galois Connection and Widening/Narrowing Approaches to Abstract Interpretation. In: Bruynooghe, M., Wirsing, M. (eds.) PLILP 1992. LNCS, vol. 631, pp. 269–295. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  5. Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Miné, A., Monniaux, D., Rival, X.: The ASTRÉE Analyzer. In: European Symposium on Programming, pp. 21–30. Springer, Edinburgh, Scotland (2005)

    Google Scholar 

  6. Cousot, P., Halbwachs, N.: Automatic Discovery of Linear Constraints among Variables of a Program. In: Principles of Programming Languages, pp. 84–97. ACM Press, Tucson, Arizona (1978)

    Google Scholar 

  7. Davenport, H.: The Higher Arithmetic, 7th edn. Cambridge University Press, Cambridge (1952)

    MATH  Google Scholar 

  8. Dor, N., Rodeh, M., Sagiv, M.: Cleanness Checking of String Manipulations in C Programs via Integer Analysis. In: Cousot, P. (ed.) SAS 2001. LNCS, vol. 2126, pp. 194–212. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  9. Dor, N., Rodeh, M., Sagiv, M.: CSSV: Towards a Realistic Tool for Statically Detecting All Buffer Overflows in C. In: Gupta, R. (ed.) Programming Language Design and Implementation, pp. 155–167. ACM Press, San Diego, USA (2003)

    Google Scholar 

  10. Goubault, E., Putot, S., Beaufreton, P., Gassino, J.: Static Analysis of the Accuracy in Control Systems: Principles and Experiments. In: FMICS 2007. 12th International Workshop on Formal Methods for Industrial Critical systems. LNCS, Springer, Heidelberg (2007)

    Google Scholar 

  11. Granger, P.: Static Analysis of Arithmetic Congruences. International Journal of Computer Mathematics 30, 165–199 (1989)

    Article  MATH  Google Scholar 

  12. Granger, P.: Static Analyses of Congruence Properties on Rational Numbers (Extended Abstract). In: Symposium on Static Analysis, pp. 278–292. Springer, London, UK (1997)

    Chapter  Google Scholar 

  13. Müller-Olm, M., Seidl, H.: Analysis of Modular Arithmetic. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 46–60. Springer, Heidelberg (2005)

    Google Scholar 

  14. Simon, A., King, A.: Analyzing String Buffers in C. In: Kirchner, H., Ringeissen, C. (eds.) AMAST 2002. LNCS, vol. 2422, pp. 365–379. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  15. Simon, A., King, A.: Exploiting Sparsity in Polyhedral Analysis. In: Hankin, C., Siveroni, I. (eds.) SAS 2005. LNCS, vol. 3672, pp. 336–351. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  16. Simon, A., King, A.: Widening Polyhedra with Landmarks. In: Kobayashi, N. (ed.) APLAS 2006. LNCS, vol. 4279, pp. 166–182. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  17. Simon, A., King, A., Howe, J.M.: Two Variables per Linear Inequality as an Abstract Domain. In: Leuschel, M.A. (ed.) LOPSTR 2002. LNCS, vol. 2664, pp. 71–89. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Hanne Riis Nielson Gilberto Filé

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Simon, A., King, A. (2007). Taming the Wrapping of Integer Arithmetic. In: Nielson, H.R., Filé, G. (eds) Static Analysis. SAS 2007. Lecture Notes in Computer Science, vol 4634. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74061-2_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-74061-2_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-74060-5

  • Online ISBN: 978-3-540-74061-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics