Ticket #1694 (closed bug: fixed)

Opened 12 years ago

Last modified 11 years ago

load_bytecode semantic differs between .pir and .pbc loading

Reported by: NotFound Owned by: NotFound
Priority: major Milestone:
Component: none Version: 2.5.0
Severity: high Keywords:
Cc: Language:
Patch status: applied Platform:

Description

This example shows the problem:

# foo.pir

.sub foo
  say 'foo'
.end
# bar.pir

.HLL 'bar'

.sub main :main
    load_bytecode 'foo.pbc'
    foo()
.end
$ parrot bar.pir
foo
$ parrot -o foo.pbc foo.pir
$ parrot bar.pir
Could not find sub foo
current instr.: 'main' pc 7 (bar.pir:7)

When loading the pir, either by explicitly asking or, as in this example, because the pbc doesn't exist, the semantic changes: the subs are inserted in the current HLL if there is no HLL directive in the loaded file.

See TT #1692

Attachments

tt1694.patch Download (0.9 KB) - added by plobsing 12 years ago.

Change History

  Changed 12 years ago by NotFound

See also TT #1686

Changed 12 years ago by plobsing

in reply to: ↑ description   Changed 12 years ago by plobsing

Replying to NotFound:

When loading the pir, either by explicitly asking or, as in this example, because the pbc doesn't exist, the semantic changes: the subs are inserted in the current HLL if there is no HLL directive in the loaded file.

I've attached a small patch that puts the start of every PIR file compilation into the default HLL. I'm not sure if this is the correct behaviour (it does pass fulltest), but at the very least it is consistent.

  Changed 11 years ago by NotFound

  • owner set to NotFound
  • status changed from new to assigned
  • patch set to applied

Now that the dynop loading problems should be solved is time to attack this issue. Slightly modified version of the patch applied in r48578. Let's see what happens.

  Changed 11 years ago by NotFound

  • status changed from assigned to closed
  • resolution set to fixed

Nothing bad happened, closing ticket.

Note: See TracTickets for help on using tickets.