V2EX  ›  英汉词典
Enqueued related words: Stack Memory

Use-after-scope

释义 Definition

use-after-scope 指“在对象/变量的作用域结束后仍继续使用它”的程序错误(常见于 C/C++)。典型情形是:函数返回后仍使用指向局部变量(栈上对象)的指针/引用,导致未定义行为,可能引发崩溃或安全漏洞。

发音 Pronunciation(IPA)

/ˌjuːs ˌæftər ˈskoʊp/

例句 Examples

This crash was caused by a use-after-scope bug.
这次崩溃是由“作用域结束后仍使用”的错误引起的。

Because the pointer still referenced a local variable after the function returned, the program triggered a use-after-scope and produced unpredictable results.
由于该指针在函数返回后仍指向一个局部变量,程序触发了 use-after-scope,产生了不可预测的结果。

词源 Etymology

该词由编程术语组合而来:use-after-(“在……之后仍使用”)+ scope(“作用域”)。它仿照更常见的漏洞命名方式 use-after-free(释放后使用),强调问题发生在“离开作用域(生命周期结束)”之后。

相关词 Related Words

文献与作品 Literary / Notable Works

  • The CERT C Secure Coding Standard(讨论对象生命周期与悬空指针等相关问题)
  • *Secure Coding in C and C++*(涵盖内存安全缺陷,包含与作用域/生命周期相关的错误模式)
  • Common Weakness Enumeration (CWE) 相关条目与说明(以行业漏洞分类形式系统描述类似缺陷)
  • LLVM/Clang AddressSanitizerClang Static Analyzer 文档(包含对 use-after-scope 检测/示例的说明)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   679 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 21:40 · PVG 05:40 · LAX 13:40 · JFK 16:40
♥ Do have faith in what you're doing.