anonym | Anmelden | Neues Konto anmelden | 2022-07-01 22:22 UTC |
Startseite | Übersicht | Probleme anzeigen | Änderungsprotokoll | Roadmap | Dokumentation | Konto |
Einfache Problemansicht anzeigen [ Zu Notizen wechseln ] | [ erweiterte Anzeige ] [ Problem-Historie ] [ Drucken ] | ||||||
ID | Kategorie | Auswirkung | Reproduzierbar | Meldungsdatum | Letzte Aktualisierung | ||
0000083 | [Barista] general | kleinerer Fehler | immer | 2011-10-19 14:42 | 2011-12-21 18:12 | ||
Reporter | rgrig | Anzeigestatus | öffentlich | ||||
Bearbeitung durch | xclerc | ||||||
Priorität | normal | Lösung | erledigt | ||||
Status | erledigt | Produktversion | 2.0-alpha | ||||
Zusammenfassung | 0000083: encode x fails, where x = decode jre6 | ||||||
Beschreibung |
A colleague tried [1] to use Barista to read the standard library of Java 6 and then write it back. The writing throws exceptions. There are two causes: 1. The library uses jsr, jsr_w, ret, which *are* allowed according to JSR 924. Barista decodes them, but refuses to encode them. 2. The order of the constant pool is shuffled, but the choice of LDC over LDC_W is preserved. A few comments. 1. I assume the current behavior is a design choice: Be forgiving when you read the input; be strict when you write the output. This, however, makes it hard to use Barista for instrumenting bytecode. Most transformations of the bytecode are local and you don't want Barista's encode function to fail because of something you did not do. A solution might be to have a pair of functions, encode and encode_strict. Another way to put it: Without looking at Barista's internals one probably expects (encode x) to succeed when x is the result of decode. 2. There are two solutions, either keep the constant pool in the high-level representation, or recompute LDC/LDC_W while encoding. I prefer the second variant. Could you also drop LDC_W completely from the Instruction (and keep it only in Bytecode)? [1] https://github.com/rgrig/papers/blob/master/safety/code/id_instr.ml [^] |
||||||
Zusätzliche Information | |||||||
Tags | Keine Tags zugeordnet. | ||||||
Angehängte Dateien | |||||||
|
Mantis 1.1.7[^] Copyright © 2000 - 2008 Mantis Group |