mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Add models for weak package, added in Go 1.24
This commit is contained in:
committed by
Owen Mansel-Chan
parent
2806e07760
commit
79232da9d4
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import "weak"
|
||||
|
||||
func TaintStepTest_WeakMake_manual(sourceCQL interface{}) interface{} {
|
||||
fromStringPointer := sourceCQL.(*string)
|
||||
intoWeakPointer := weak.Make(fromStringPointer)
|
||||
return intoWeakPointer
|
||||
}
|
||||
func TaintStepTest_WeakValue_manual(sourceCQL interface{}) interface{} {
|
||||
fromWeakPointer := sourceCQL.(weak.Pointer[string])
|
||||
intoStringPointer := fromWeakPointer.Value()
|
||||
return intoStringPointer
|
||||
}
|
||||
|
||||
func RunAllTaints_Weak() {
|
||||
{
|
||||
source := newSource(0)
|
||||
out := TaintStepTest_WeakMake_manual(source)
|
||||
sink(0, out)
|
||||
}
|
||||
{
|
||||
source := newSource(1)
|
||||
out := TaintStepTest_WeakValue_manual(source)
|
||||
sink(1, out)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user