mewmew / uc

A compiler for the µC language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

irgen: "converting from *types.Pointer"

mewmew opened this issue · comments

commented

The convert method has support for extending and truncating integers. For all other types, it verifies that the type of the given value and the specified type are equal.

For some reason, these types are not equal for the following test cases. Investigate why this may be the case, and fix the underlying issue. That is, do not adjust convert to "add support for" *types.Pointer, but rather fix the issue at its source.

  • testdata/noisy/advanced/bubble.c
  • testdata/noisy/advanced/quick.c
  • testdata/noisy/simple/sim09.c

Converting from *types.Pointer

testdata/noisy/advanced/bubble.c

Compiling "testdata/noisy/advanced/bubble.c"
panic: support for converting from type *types.Pointer not yet implemented

github.com/mewmew/uc/irgen.(*Module).convert(0xc420081d00, 0xc420011c80, 0x611d60, 0xc420011ce0, 0x610ea0, 0xc4200c0510, 0x559680, 0x58d5f4)
    /home/u/Desktop/go/src/github.com/mewmew/uc/irgen/util.go:39 +0xd86

testdata/noisy/advanced/quick.c

Compiling "testdata/noisy/advanced/quick.c"
panic: support for converting from type *types.Pointer not yet implemented

github.com/mewmew/uc/irgen.(*Module).convert(0xc420081d00, 0xc4200c28e0, 0x611d60, 0xc4200c2a60, 0x610ea0, 0xc4200a6fa0, 0x558120, 0x0)
    /home/u/Desktop/go/src/github.com/mewmew/uc/irgen/util.go:39 +0xd86

testdata/noisy/simple/sim09.c

Compiling "testdata/noisy/simple/sim09.c"
panic: support for converting from type *types.Pointer not yet implemented

github.com/mewmew/uc/irgen.(*Module).convert(0xc420081d00, 0xc4200bcd40, 0x611d60, 0xc4200bcda0, 0x610ea0, 0xc4200ba330, 0x5d597a, 0x38bbd)
    /home/u/Desktop/go/src/github.com/mewmew/uc/irgen/util.go:39 +0xd86
commented

The issue has been resolved with no modification of the convert function, as was initially suggested. Re-open this issue, if any other test cases fail within the convert function.