Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datatype's underline array is persisted as *uint8 pointer value #2704

Closed
piux2 opened this issue Aug 15, 2024 · 2 comments
Closed

Datatype's underline array is persisted as *uint8 pointer value #2704

piux2 opened this issue Aug 15, 2024 · 2 comments
Assignees
Labels
🐞 bug Something isn't working

Comments

@piux2
Copy link
Contributor

piux2 commented Aug 15, 2024

Description

Problem:

A ByteTypeValue should not be persisted as it contains the underline array. However when it is assigned to a uint8 PointerType variable , the underlien array got persisted

Testing Case:

// PKGPATH: gno.land/r/test
package test

var a0, a1 *uint8

func main() {
a := []byte("helloooooooooooooooooooooo")
a1 = &a[1]
a0 = &a[0]

}

// Realm:
// switchrealm["gno.land/r/test"]
+c[a8ada09dee16d791fd406d629fe29bb0ed084a30:4]={

  • "Data": "aGVsbG9vb29vb29vb29vb29vb29vb29vb28AAAAAAAA=", <<<< "helloooooooooooooooooooooo"
  • "List": null,
  • "ObjectInfo": {
  •    "ID": "a8ada09dee16d791fd406d629fe29bb0ed084a30:4",
    
  •    "IsEscaped": true,
    
  •    "ModTime": "0",
    
  •    "RefCount": "2"
    
  • }
    +}
@piux2 piux2 self-assigned this Aug 15, 2024
@piux2 piux2 changed the title Datatype is persisted as *uint8 pointer value Datatype's underline array is persisted as *uint8 pointer value Aug 15, 2024
@zivkovicmilos zivkovicmilos added 🌟 must have 🌟 🐞 bug Something isn't working labels Sep 11, 2024
@piux2
Copy link
Contributor Author

piux2 commented Oct 14, 2024

This is not a bug. We can change the value of a0, which can modify the underlying array. Therefore, the underlying array needs to be persisted.

@piux2 piux2 closed this as completed Oct 14, 2024
@linear linear bot reopened this Nov 1, 2024
@thehowl
Copy link
Member

thehowl commented Nov 6, 2024

Linear re-opened this, but it's incorrect.

@thehowl thehowl closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Development

No branches or pull requests

3 participants