Skip to content
  • Brooks Davis's avatar
    Support initializing stack variables on function entry · e268fd0a
    Brooks Davis authored
    There are two options:
     - WITH_INIT_ALL_ZERO: Zero all variables on the stack.
     - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns.
    
    The exact pattern are a compiler implementation detail and vary by type.
    They are somewhat documented in the LLVM commit message:
    https://reviews.llvm.org/rL349442
    I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather
    than naming them after the LLVM specific compiler flags.
    
    In a range of consumer products, options like these are used in
    both debug and production builds with debugs builds using patterns
    (intended to provoke crashes on use of uninitialized values) and
    production using zeros (deemed more likely to lead to harmless
    misbehavior or NULL-pointer dereferences).
    
    Reviewed by:	emaste
    Obtained from:	CheriBSD
    Sponsored by:	DARPA
    Differential Revision:	https://reviews.freebsd.org/D27131
    e268fd0a