ACM SIGPLAN Notices · 2005 · 64 citations · 24 references
ComputingComputer EngineeringComputer ScienceCompilersComputational LinguisticsProgramming LanguagesControl-flow AnalysisData-flow AnalysisForeign Function InterfacesMemory SafetyType CheckingType SystemsC Foreign Function InterfaceDataflow SemanticsInterprocedural Dataflow AnalysisSafe Foreign Function InterfacesType InferenceType SafetyType TheoryUnsafe Foreign Function Interfaces
We present a multi-lingual type inference system for checking type safety across a foreign function interface. The goal of our system is to prevent foreign function calls from introducing type and memory safety violations into an otherwise safe language. Our system targets OCaml's FFI to C, which is relatively lightweight and illustrates some interesting challenges in multi-lingual type inference. The type language in our system embeds OCaml types in C types and vice-versa, which allows us to track type information accurately even through the foreign language, where the original types are lost. Our system uses representational types that can model multiple OCaml types, because C programs can observe that many OCaml types have the same physical representation. Furthermore, because C has a low-level view of OCaml data, our inference system includes a dataflow analysis to track memory offsets and tag information. Finally, our type system includes garbage collection information to ensure that pointers from the FFI to the OCaml heap are tracked properly. We have implemented our inference system and applied it to a small set of benchmarks. Our results show that programmers do misuse these interfaces, and our implementation has found several bugs and questionable coding practices in our benchmarks.
24
George C. Necula, Scott McPeak, Westley Weimer · ACM SIGPLAN Notices · 2012 · 511 citations
Precise analysis of string expressions
2003 · 400 citations
Computing, Computer Science, Natural Language Processing +14
George C. Necula, Scott McPeak, Westley Weimer · 2002 · 371 citations