mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
interp: support GEP on fixed (MMIO) addresses
GetElementPtr would not work on values that weren't pointers. Because fixed addresses (often used in memory-mapped I/O) are integers rather than pointers in interp, it would return an error. This resulted in the teensy40 target not compiling correctly since the interp package rewrite. This commit should fix that.
This commit is contained in:
+2
-2
@@ -348,7 +348,7 @@ func (v literalValue) clone() value {
|
||||
}
|
||||
|
||||
func (v literalValue) asPointer(r *runner) (pointerValue, error) {
|
||||
return pointerValue{}, errLiteralToPointer
|
||||
return pointerValue{}, errIntegerAsPointer
|
||||
}
|
||||
|
||||
func (v literalValue) asRawValue(r *runner) rawValue {
|
||||
@@ -949,7 +949,7 @@ func (v rawValue) clone() value {
|
||||
func (v rawValue) asPointer(r *runner) (pointerValue, error) {
|
||||
if v.buf[0] <= 255 {
|
||||
// Probably a null pointer or memory-mapped I/O.
|
||||
return pointerValue{}, errExpectedPointer
|
||||
return pointerValue{}, errIntegerAsPointer
|
||||
}
|
||||
return pointerValue{v.buf[0]}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user