Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

out-of-bound errors happen in other languages as well. use-after-free happens in almost every language that is not gc'ed.


> out-of-bound errors happen in other languages as well.

In sane languages an out-of-bounds error causes program termination, unless it was disabled on purpose (assuming it can be disabled). In C anything goes.

An out of bounds can cause the program to be injured, but not die, and eventually have some kind of inconsistent state.

> use-after-free happens in almost every language that is not gc'ed.

Yes, true if we are speaking about Modula-2 or Extended Pascal dialects. The most notable alternatives to C with manual memory management.

Everything else has at very least reference counting support.


Reference counting does not avoid using something after freeing it...


Then the reference counting is not properly implemented, otherwise reference count would be greater than zero.


    object = create_object() // RC 1
    object.release() // RC 0 => will be released
    // ...
    object.doSomething() // Used after object was released

?


I think parent means reference counting built into the language (like Python)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: