ENع
الدرس 11 · Memory

Undefined behaviour: one read past the end

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

Some mistakes in C++ are not errors at all in the eyes of the language: the standard simply stops saying what happens. Follow an eight-line program whose loop reads one element past the end of an array. It compiles without a warning, nothing checks the read, and the result is undefined. Then see why optimisers make it worse, how AddressSanitizer catches it, and how to fix it.

11 دقيقة10 خطوات5 أسئلةIntermediate
شكل 11 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.