2020-12-14

Pointers Are Complicated II, or: We need better language specs

The article explores how pointer provenance affects compiler optimizations, demonstrating how three seemingly correct LLVM transformations can lead to incorrect results when combined. The author argues for treating compiler IRs as proper programming languages with precise specifications to prevent optimization conflicts, particularly regarding pointer-integer casts and provenance tracking.

Original archive.is archive.ph web.archive.org

Log in to get one-click access to archived versions of this article.

Related articles

Abusing C to implement JSON Parsing with Struct Methods

A detailed guide on building a JSON parser in C, focusing on creating a memory-safe implementation with an ergonomic API and struct-attached functions as methods. Key features include comprehensive compiler flags setup, robust memory management, and simplified JSON value representation.

Securing tomorrow's software: the need for memory safety standards

Memory safety vulnerabilities have been a persistent security challenge costing billions, prompting a call for industry-wide standardization and secure-by-design practices. Recent advancements in memory-safe languages like Rust and hardware technologies offer promising solutions for widespread adoption. Google advocates for establishing a common framework to assess memory safety assurances and drive industry-wide adoption of secure practices.

Clang Static Analyzer and the Z3 constraint solver

A detailed exploration of using Z3 constraint solver with Clang Static Analyzer to reduce false positives in code analysis. The integration offers two methods: using Z3 as an external constraint solver or employing it for false positive filtering, with the latter being significantly faster.

Re: Rust kernel policy

Greg KH, a Linux kernel maintainer, strongly advocates for incorporating Rust into the kernel, citing how it eliminates common C-related bugs and memory safety issues. He emphasizes that Rust would particularly benefit new code and drivers, while acknowledging the ongoing importance of improving the existing C codebase. The discussion addresses concerns about mixed-language maintenance and developer adaptation.

Why I'm Writing a Scheme Implementation in 2025 (The Answer is Async Rust)

A developer introduces scheme-rs, a work-in-progress R6RS implementation designed for seamless interoperability with async Rust. The project aims to solve async Rust's debugging and iteration challenges while serving as a foundation for a future language called Gouki, which will combine Scheme's macro system with advanced typing features.

It Is Time to Standardize Principles and Practices for Software Memory Safety

Memory-safety vulnerabilities have constituted approximately two-thirds of critical security vulnerabilities in major software systems for over two decades, enabling widespread malware and targeted attacks. Strong memory-safety technologies have matured sufficiently for deployment, but lack standardized terminology and frameworks for implementation and procurement. Market failure and misaligned incentives have hindered adoption of memory-safe solutions, despite their potential to prevent catastrophic security breaches.

How Does Ada's Memory Safety Compare Against Rust?

An in-depth comparison of memory safety features between Rust and Ada programming languages, examining how each handles common memory-related errors like buffer overflows, use-after-free, and race conditions, while highlighting their unique approaches to preventing these issues through compile-time checks and runtime protections.

Zig; what I think after months of using it

A developer shares their experience with Zig after months of usage, highlighting both strengths and significant concerns about the language's design choices and safety guarantees, particularly comparing it to Rust and questioning its approach to simplicity over memory safety.