Lines Matching full:shadow
17 // These return the shadow memory pointer for loading the shadow value,
21 // Sets the shadow types appropriately and returns the shadow memory
22 // pointer for storing the shadow value.
24 // accuracy of a value against its shadow and emits a warning depending
27 // shadow, and depends on the instrumentation configuration.
29 // corresponding shadow fcmp result differs.
56 // When copying application memory, we also copy its shadow and shadow type.
88 ShadowFT Shadow; in ReadShadowInternal() local
89 __builtin_memcpy(&Shadow, ptr, sizeof(Shadow)); in ReadShadowInternal()
90 return Shadow; in ReadShadowInternal()
198 // The next three functions return a pointer for storing a shadow value for `n`
199 // values, after setting the shadow types. We return the pointer instead of
203 // since we are setting the type shadow memory.
243 // shadow value of the given type and return a pointer for loading.
287 // Returns the raw shadow pointer. The returned pointer should be considered
294 // Returns the raw shadow type pointer. The returned pointer should be
326 const u8 *const shadow = GetShadowAddrFor(addr); in __nsan_dump_shadow_mem() local
359 ReadShadow(shadow + kShadowScale * (Offset + 1 - sizeof(float)), in __nsan_dump_shadow_mem()
368 shadow + kShadowScale * (Offset + 1 - sizeof(double)), in __nsan_dump_shadow_mem()
377 shadow + kShadowScale * (Offset + 1 - sizeof(long double)), in __nsan_dump_shadow_mem()
416 // Checks the consistency between application and shadow value. Returns true
418 // rather than the shadow value. This prevents one error to propagate to all
421 int32_t checkFT(const FT value, ShadowFT Shadow, CheckTypeT CheckType, in checkFT() argument
427 const InternalFT check_shadow = Shadow; in checkFT()
445 // (value and shadow are inf or -inf), we pass the test. in checkFT()
484 Printf("WARNING: NumericalStabilitySanitizer: inconsistent shadow results"); in checkFT()
499 "shadow memory tracking, typically due to uninstrumented code " in checkFT()
519 "%-12s precision (shadow): dec: %s hex: %s\n" in checkFT()
520 "shadow truncated to %-12s: dec: %s hex: %s\n" in checkFT()
526 ShadowPrinter::dec(Shadow).Buffer, ShadowPrinter::hex(Shadow).Buffer, in checkFT()
527 FTInfo<FT>::kCppTypeName, ValuePrinter::dec(Shadow).Buffer, in checkFT()
528 ValuePrinter::hex(Shadow).Buffer, RelErrBuf, in checkFT()
549 float value, double shadow, int32_t check_type, uptr check_arg) { in __nsan_internal_check_float_d() argument
550 return checkFT(value, shadow, static_cast<CheckTypeT>(check_type), check_arg); in __nsan_internal_check_float_d()
554 double value, long double shadow, int32_t check_type, uptr check_arg) { in __nsan_internal_check_double_l() argument
555 return checkFT(value, shadow, static_cast<CheckTypeT>(check_type), check_arg); in __nsan_internal_check_double_l()
559 double value, __float128 shadow, int32_t check_type, uptr check_arg) { in __nsan_internal_check_double_q() argument
560 return checkFT(value, shadow, static_cast<CheckTypeT>(check_type), check_arg); in __nsan_internal_check_double_q()
564 __nsan_internal_check_longdouble_q(long double value, __float128 shadow, in __nsan_internal_check_longdouble_q() argument
566 return checkFT(value, shadow, static_cast<CheckTypeT>(check_type), check_arg); in __nsan_internal_check_longdouble_q()
616 // to simplify instrumented code. Skip elements where the shadow comparison in fCmpFailFT()
636 // FIXME: ideally we would print the shadow value as FP128. Right now because in fCmpFailFT()
638 // shadow <value> == <value> (false) in fCmpFailFT()
648 "%-12s precision dec (shadow): %s %s %s (%s)\n" in fCmpFailFT()
650 "%-12s precision hex (shadow): %s %s %s (%s)\n" in fCmpFailFT()
655 // Shadow, decimal in fCmpFailFT()
662 // Shadow, hex in fCmpFailFT()
706 // Get the shadow 2FT value from the shadow stack. Note that in checkFTFromShadowStack()
708 // the instrumentation will have placed the shadow value on the shadow stack. in checkFTFromShadowStack()
710 ShadowFT Shadow; in checkFTFromShadowStack() local
711 __builtin_memcpy(&Shadow, __nsan_shadow_args_ptr, sizeof(ShadowFT)); in checkFTFromShadowStack()
712 checkFT(value, Shadow, CheckTypeT::kUser, 0); in checkFTFromShadowStack()
738 // Get the shadow 2FT value from the shadow stack. Note that in dumpFTFromShadowStack()
740 // the instrumentation will have placed the shadow value on the shadow stack. in dumpFTFromShadowStack()
742 ShadowFT shadow; in dumpFTFromShadowStack() local
743 __builtin_memcpy(&shadow, __nsan_shadow_args_ptr, sizeof(ShadowFT)); in dumpFTFromShadowStack()
747 "shadow dec:%s hex:%s\n", in dumpFTFromShadowStack()
749 ShadowPrinter::dec(shadow).Buffer, ShadowPrinter::hex(shadow).Buffer); in dumpFTFromShadowStack()