Closed Bug 541552 Opened 15 years ago Closed 15 years ago

make trans_data_frag more typesafe

Categories

(Servo Graveyard :: Rust, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: graydon, Assigned: graydon)

References

Details

Currently Trans.trans_data_frag returns an Il.Imm with an address in it. This is vestigial type-unsafety that we should be flushing out of the IL/trans layer: it should return an Addr, and the callers should be adjusted to lea it if they actually need it in an operand.
Weirder and worse than that: the results of data translation should be crate-relative or base-relative displacements, as part of making trans PIC-clean.
Blocks: 547252
Assignee: nobody → graydon
This has been fixed -- or at least no longer relevant -- for a while, probably around 1d9c1563213f. Now trans_data_frag returns signed displacements, and (alas) the IL type system doesn't have a concept of a signed-displacement-from-crate-to-rty, so the type unsafety is unavoidable. But there are also new wrappers to translate back from the displacements to typed pointers (crate_rel_to_ptr etc.), so I think it's as good as it'll get.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Group: servo
You need to log in before you can comment on or make changes to this bug.