-1
我有一个令人难以置信的段崩溃调用堆栈在C中,任何人都可以帮我吗?令人难以置信的程序崩溃调用堆栈
int function(struct A *a)
{
... some other declare
struct B *b = a->b;
int count, len;
... some other declare
struct C *c = b->c; /* not crash here */
....some other decalre
if (b->e) { /*crash log indicate b is NULL and crash here,first line instrucment code*/
.....
}
....
}
我的问题是为什么碰撞没有发生在struct C *c = b->c
。
GCC是编译器。
Tony
你见过任何能保证文档“崩溃”的东西吗? –
访问无效指针是未定义的行为。只要UB遇到,编译器就没有义务保证崩溃。根据定义UB意味着行为是不可预测的。 – kaylum
什么是令人难以置信的细分市场?我想更多地了解这些! –