github-vet / github-vet/rangeloop-pointer-findings

ssttevee/go-quickjs: internal/classes.go; 5 LoC

Open
#15,220 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [ssttevee/go-quickjs](https://www.github.com/ssttevee/go-quickjs) at [internal/classes.go](https://github.com/ssttevee/go-quickjs/blob/47b1c0b8b4329cc69c1b0451a5bea2e9bbe43ed3/internal/classes.go#L17-L21)

Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.

>

[Click here to see the code in its original context.](https://github.com/ssttevee/go-quickjs/blob/47b1c0b8b4329cc69c1b0451a5bea2e9bbe43ed3/internal/classes.go#L17-L21)

Click here to show the 5 line(s) of Go which triggered the analyzer.

```go
for id, def := range classDefs {
if C.JS_NewClass(rt, id, &def) != 0 {
panic(fmt.Sprintf("failed to define custom class: %s", C.GoString(def.class_name)))
}
}

```

Click here to show extra information the analyzer produced.

```
No path was found through the callgraph that could lead to a function which writes a pointer argument.

No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.

root signature {JS_NewClass 3} was not found in the callgraph; reference was passed directly to third-party code
```

Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.

commit ID: 47b1c0b8b4329cc69c1b0451a5bea2e9bbe43ed3

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with internal/classes.go and the referenced JS_NewClass call, then read the range-loop and cgo pointer rules relevant to passing &def. Determine whether this instance is a real issue and classify it as Bug, Mitigated, or Desirable Behavior using the project's linked descriptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.