View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000650 | LDMud 3.5 | Runtime | public | 2009-06-03 12:29 | 2017-09-30 16:46 |
Reporter | Gnomi | Assigned To | Gnomi | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | i686 | OS | Debian GNU/Linux | OS Version | 4.0 |
Fixed in Version | 3.5.0 | ||||
Summary | 0000650: lvalue 2: Give variable references unlimited lifespan | ||||
Description | Currently it is possible to create variable references that life longer than the variable itself: int var; return ({ 0 || &var }); This function would return an lvalue to an invalid stack entry. The compiler tries to check this (return &var; is forbidden), but I don't think it can catch all possibilities. There are to kinds of variable lvalues: Implicit (var = ...) and explicit (&var). The first kind will have subtype LVALUE_UNPROTECTED and any such lvalue must be consumed by the next operation, it's reference to the svalue is uncounted (just as it is now). The second kind will have subtype LVALUE_PROTECTED and points to a dynamically allocated structure consisting of a reference count and a svalue_t. Whenever an explicit reference to a variable is done, the contents of the variable is copied to such a structure and the variable itself is replaced by a protected lvalue pointing to this structure. &(arr[i]) can also be implemented that way without the need for protector references of the array. All other protected lvalue structures (for ranges) get a reference counter, too. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2009-06-03 12:29 | Gnomi | New Issue | |
2009-06-03 12:29 | Gnomi | Status | new => assigned |
2009-06-03 12:29 | Gnomi | Assigned To | => Gnomi |
2009-06-03 12:30 | Gnomi | Relationship added | parent of 0000487 |
2009-06-03 12:31 | Gnomi | Relationship added | child of 0000546 |
2017-09-30 16:46 | Gnomi | Status | assigned => resolved |
2017-09-30 16:46 | Gnomi | Resolution | open => fixed |
2017-09-30 16:46 | Gnomi | Fixed in Version | => 3.5.0 |